About Object
- What is the object?
- Objects group together a set of variables and functions to create a model of a something you would recognize from the real world.
- objects in JavaScript may be defined as an unordered collection of related data, of primitive or reference types.
- object is an abstract data type with the addition of polymorphism and inheritance. Rather than structure programs as code and data.
- This object represents a hotel. It has five properties and one method.
- The object is in curly braces. It is stored in a variable called hotel.
More About Object
- An object cannot have two keys with the same name.
- The value of a property can be a string, number, Boolean, array, or another object.
- The value of a method is always a function.
Document Object Model
The Document Object Model specifies how browsers should create a model of an HTML page and how JavaScript can access and update the contents of a web page while it is in the browser window
-
The DOM tree is a model of web page
-
This image will explain more about DOM elements
- This is an example of body contents ```
Buy groceries
- fresh figs
- pine nuts</l i>
honey</l i > balsamic vinegar</l i> </ ul >