js定义对象简单学习例子 时间:2020-05-12 人气:0 无标题页 <script language="javascript" type="text/javascript"> function student(name,sex,age){ this.name = name; this.sex = sex; this.age = age; this.resume = resume; } function resume(){ return (this.name + this.sex + this.age); } var myStudent = new student("阿会楠","男",22); var resume = myStudent.resume(); with(document){ write(myStudent.name + " "); write(myStudent.sex + " "); write(myStudent.age + " "); write(resume); } </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 加载全部内容