运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,暗/亮
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Objects</h1> <h2>Creating an Object</h2> <p id="demo"></p> <script> // Create an Object: const car = {type:"Fiat", model:"500", color:"white"}; // Display Data from the Object: document.getElementById("demo").innerHTML = "The car type is " + car.type; </script> </body> </html>