Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <h2>JavaScript Objects</h2>
- <p id="demo"></p>
- <script>
- // Create an object:
- var person = {
- firstName: "John",
- lastName: "Doe",
- age: 50,
- eyeColor: "blue"
- };
- // Display some data from the object:
- document.getElementById("demo").innerHTML =
- person.firstName + " is " + person.age + " years old.";
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement