JavaScript通过function定义对象
function member(name,gander){ //类的属性 this.name=name; this.gander=gander; } // 下面是实例化对象 var m1 = new member("脚本分享网","sb"); var m2 = new member("sharejs","sb"); var m3 = new member("javascript","sb"); with(document){ write(m1.name+":"+m1.gander+"<br>"); write(m2.name+":"+m2.gander+"<br>"); write(m3.name+":"+m3.gander+"<br>"); }