JavaScript 如何给对象添加方法

来源:互联网 发布:freehand软件用法 编辑:程序博客网 时间:2024/04/27 16:00
<html><body><button type="button" onclick="car.display()">点击这里</button><script>var car={class:"cars"};car.display=function(){    alert("Welcome Arnold!");}</script></body></html>
1 0
原创粉丝点击