- 1
What is node counting logic in javascript?
may b in javascript nodes are counting like as starting point node 1..end tag of same tag as node 3..am I r8?
2 ответов
+ 6
I'm not sure to good understang your unclear question, but I will try some explanation:
A 'tag' is the text for coding an html 'element'.
Almost elements can embed content, so require an opening and a closing tags.
Each tag/element can have some attributes.
The 'DOM' ( document object model ) is the data structure used to store the parsed html code.
This data structre is a tree list, composed of 'nodes'.
Each 'node' can be of different type: element, attribut, text, comment, and so on... but an element is stored in once node, as the closing tag is only necessary in text encoding of this tree list structure, not else ( structure is encoded by assigning childs lists and parent references properties to the node object ).
- 1
thank u