+ 4
what is concept of nodes in js
1 ответ
+ 5
the browser builds a representation
of your html code called the
Document Object Model (DOM)
the DOM is like a tree
let us consider
<html>
<p>
</p>
<p>
<span>
</span>
</p>
</html>
the tree is like
html
|
________p
|
________p
|
________ span
the
first p and the span elements are called nodes
as they have nothing after them
the html and the second p are parents
nodes are also called children
maybe visualising it all as family trees help
it is called trees as if you take a tree and turn it
upside down you get it