时间:2021-07-01 10:21:17 帮助过:5人阅读
function MyClass()
{
//This function is same as a constructer
alert("New Object Created");
}
//Creating Object
var MyObject = new MyClass ();
NewObject.prototype =
{
//Adding Method named "MyMethod"
MyMethod: function(){alert("My Method");} ,
//Adding property named "MyProperty"
MyProperty: "My Property"
}
//Calling Method
MyObject.MyMethod();
//Assigning Property
MyObject.MyProperty = "My Property Value changed";