//构造函数/也叫对象模板
function Student(){
this.sname=sname;
this.sage=sage;
this.intrSelf=function(){
dialog.innerHTML="I'm "+this.sname+"+,I'm "+this.sage;
dialog.style.display="block";
}
}
//Step2:用new调用构造函数,传入属性值
var lilei=new Student("Li Lei",18);
var hmm=new Student("Han Meimei",19);
function Student(){
this.sname=sname;
this.sage=sage;
this.intrSelf=function(){
dialog.innerHTML="I'm "+this.sname+"+,I'm "+this.sage;
dialog.style.display="block";
}
}
//Step2:用new调用构造函数,传入属性值
var lilei=new Student("Li Lei",18);
var hmm=new Student("Han Meimei",19);