您的位置:首页 > Web前端 > JavaScript

js定义对象简单学习例子

2007-09-21 00:00 525 查看
无标题页


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);
}





[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: