reading-notes2

https://m7madmomani2.github.io/reading-notes2

View the Project on GitHub M7madMomani2/reading-notes2

Objects

I2

What is Objects ?

Objects group together a set of variables and functions to create a model of a something you would recognize from the real world. In an object, variables and functions take on new names.

I1

Document Object Model

What is Document Object Model ?

  • The Document Object Model (DOM) 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 browser represents the page using a DOM tree.
  • DOM trees have four types of nodes: document nodes, element nodes, attribute nodes, and text nodes.
  • You can select element nodes by their id or cl ass attributes, by tag name, or using CSS selector syntax.
  • Whenever a DOM query can return more than one node, it will always return a Nadel i st.
  • From an element node, you can access and update its content using properties such as textContent and i nnerHTML or using DOM manipulation techniques.
  • An element node can contain multiple text nodes and child elements that are siblings of each other.
  • In older browsers, implementation of the DOM is inconsistent (and is a popular reason for using jQuery).
  • Browsers offer tools for viewing the DOM tree .