W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <h1>JavaScript 对象</h1> <p>JavaScript 使用名称来访问对象属性。</p> <p id="demo"></p> <script> var person = {firstName:"Bill", lastName:"Gates", age:62}; document.getElementById("demo").innerHTML = person["firstName"]; </script> </body> </html>