04JS高级动态添加属性和删除属性

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script type ="text/javascript">
        var obj = new Object();
        obj.name = "张三"; //添加属性
        alert(obj.name);
        delete obj.name; //删除属性
    </script>
</head>
<body>

</body>
</html>

  

posted @ 2014-06-14 00:06  编程猴子  阅读(402)  评论(0编辑  收藏  举报