Monday, 20 May 2013

why cant you access first div element of body like document.body.div[0] in html/javascript [migrated]

why cant you access first div element of body like document.body.div[0] in html/javascript [migrated]

i can do document.body.childNodes[1] but why not this. How does it work for document then.
Sorry if i am missing something.
Following this logic, body should have been only accessible through
document.childNodes[1] or so.
Why does it work like this.

No comments:

Post a Comment