User:Zuhui//Prototyping/Javascript: Difference between revisions

From XPUB & Lens-Based wiki
< User:Zuhui‎ | ‎ | Prototyping
(Created page with "=DOM= [https://dev.to/sidramaqbool/understanding-dom-nodes-a-comprehensive-guide-with-example-22m5 dev/understanding dom nodes - a comprehensive guide with example]")
 
No edit summary
Line 1: Line 1:
[[File:Spaghetti-wall.png|thumb]]
=DOM=
=DOM=
[https://dev.to/sidramaqbool/understanding-dom-nodes-a-comprehensive-guide-with-example-22m5 dev/understanding dom nodes - a comprehensive guide with example]
'''[https://dev.to/sidramaqbool/understanding-dom-nodes-a-comprehensive-guide-with-example-22m5 dev/understanding dom nodes - a comprehensive guide with example]'''<br><br>
'''What is Document Object Model'''
* DOM is a '''tree structure''' that browsers use to understand and represent a web page.
* in this tree, '''each element is called a node'''.
** '''Document Node:''' This is the top-level node in the DOM and represents the entire HTML document.
** '''Element Node:''' This represents an HTML element, such as <code>div</code>, <code>p</code>, <code>ul</code>, etc.
** '''Attribute Node:''' This represents an attribute of an HTML element, such as <code>id</code>, <code>class</code>, <code>src</code>, etc.
** '''Text Node:''' This represents the actual text within an HTML element
so '''"manipulating the DOM"''' means modifying or exploring this tree structure of the web page.

Revision as of 17:30, 21 February 2025

Spaghetti-wall.png

DOM

dev/understanding dom nodes - a comprehensive guide with example

What is Document Object Model

  • DOM is a tree structure that browsers use to understand and represent a web page.
  • in this tree, each element is called a node.
    • Document Node: This is the top-level node in the DOM and represents the entire HTML document.
    • Element Node: This represents an HTML element, such as div, p, ul, etc.
    • Attribute Node: This represents an attribute of an HTML element, such as id, class, src, etc.
    • Text Node: This represents the actual text within an HTML element

so "manipulating the DOM" means modifying or exploring this tree structure of the web page.