日期:2014-05-16 浏览次数:20343 次
<script type="text/javascript" language="javascript"> function Person(name,age) { this.Name = name; this.Age = age; this.sayhello = function () { alert("nihao,wo shi"+this.Name+",wo"+this.Age+"sui"); } } var p1 = new Person("xuning", 27); p1.sayhello(); p1.gender = "男人"; //这样都可以的,毛毛哦~~动态的 alert(p1.gender); </script>