<script language="javascript">
function myclass(sTypename,oTag){
aaa=this;
this.typename=sTypename;
this.tag=oTag;
this.tag.onclick=function (){aaa.onclick()};
}
myclass.prototype.show=function(){
this.tag.innerHTML=this.typename;
}myclass.prototype.onclick=function(){
alert(arguments.length);
alert(this.typename);
}var oMycls=new myclass("abc",document.getElementById("mydiv"));
oMycls.show();</script>
function myclass(sTypename,oTag){
aaa=this;
this.typename=sTypename;
this.tag=oTag;
this.tag.onclick=function (){aaa.onclick()};
}
myclass.prototype.show=function(){
this.tag.innerHTML=this.typename;
}myclass.prototype.onclick=function(){
alert(arguments.length);
alert(this.typename);
}var oMycls=new myclass("abc",document.getElementById("mydiv"));
oMycls.show();</script>
<script language="javascript">
function myclass(sTypename,oTag){
aaa=this;
this.typename=sTypename;
this.tag=oTag;
this.tag.onclick=function (event){aaa.onclick(event)};
}
myclass.prototype.show=function(){
this.tag.innerHTML=this.typename;
}myclass.prototype.onclick=function(e){
var e=e||window.event;
var obj = e.srcElement||e.target;
alert(obj.tagName);
alert(arguments.length);
alert(this.typename);
}var oMycls=new myclass("abc",document.getElementById("mydiv"));
oMycls.show();</script>