javascript中创建有方法的自定义对象

来源:互联网 发布:adas软件下载 编辑:程序博客网 时间:2024/05/16 11:56
<!DOCTYPE html><html lang="en"><head>    <meta http-equiv="content-type" content="text/html;charset=UTF-8">    <title>javascript中创建有方法的自定义对象</title>    <script type="text/javascript">        <!--          var monitor={              price:1800,              factory:"元洪公司",              type:"A等",              size:17,              open:new Function("document.write('显示器已经打开了')")          };          document.write("显示器的生产厂家:",monitor.factory,"<br/>");        document.write("显示器的型号:",monitor.type,"<br/>");        document.write("显示器的尺寸:",monitor.size,"<br/>");        document.write("显示器的价格:",monitor.price,"<br/>");        monitor.open();        -->    </script></head><body></body></html>
0 0
原创粉丝点击