标签:style blog io ar color sp on div log
【js】 对象
一. 创建对象的三种方式
<script> var v1 = new Object(); v1.name = "name1"; v1.age = 19; v1.sex = 1; alert(v1.name); function obj(name, age, sex) { this.name = name; this.age = age; this.sex = sex; } var v2 = new obj("name2", 18, 1); alert(v2.name); v3 = { name: "name3", age: 20, sex: 1 }; alert(v3.name); </script>
标签:style blog io ar color sp on div log
原文地址:http://www.cnblogs.com/fzz2727551894/p/4165439.html