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

面向对象的javascript

2005-12-19 16:15 423 查看
<html>
<head>
<title>
测试页面
</title>
</head>
<body>

<Script>
function member(name,sex)
{
this.name = name;
this.sex = sex;
this.display = display;
}
function display()
{
document.write(this.name+"是"+this.sex+"人");
}
var papa = new member("小毛","男");
papa.display();

</Script>

</body>

</html>
-------------------
以上是个例子
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: