自己动手-Javascript面向对象-继承
function Person(){this.name="haha";this.sext="boy";this.getName=function(){alert(this.name);}this.classroom="Person classroom"};function Student(){};Student.prototype=new Person();Student.prototype.classroom="Student room";var student1=new Student();var student2=new Student();alert("student1-classroom-->"+student1.classroom);alert("student2-classroom-->"+student2.classroom);alert("开始修改");student1.classroom="这是student1 room";alert("student1-classroom-->"+student1.classroom);alert("student2-classroom-->"+student2.classroom);?