W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <body> <script type="text/javascript"> function showColor() { alert(this.color); }; var oCar1 = new Object; oCar1.color = "red"; oCar1.showColor = showColor; var oCar2 = new Object; oCar2.color = "blue"; oCar2.showColor = showColor; oCar1.showColor(); oCar2.showColor(); </script> </body> </html>