javascript - DOM traversal up to window? -


with following bit of code -

var myel = document.getelementbyid('myelement'); myel.ownerdocument.defaultview; 

does getting original window via ownerdocument.defaultview mean i'm traversing dom myel element document , window?

it's not traversing, per se.

every dom object has ownerdocument property. document node associated with, if any.

every document object has defaultview property (provided browser supports -- not true in ie <9). window object document shown, if any,.

so it's reading couple of properties objects, rather traversal.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -