Element.ownerDocument (Property)

A reference to the document object that the element is contained within.


DOM level - 1
JavaScript - 1.5
JScript - 5.0
Internet Explorer - 5.0
Netscape - 6.0
Property/method value type:Document object
JavaScript syntax:-myElement.ownerDocument

This is another name for the document property of an Element object. They both refer to the same object.

This is provided by MSIE 5 and Netscape 6.0 as a convenience property. Accessing a containing document object in this way is far easier than walking down a document.childElement sequence to locate a contained document.

See also:Document object, Element object, Element.document, Hierarchy of objects, Node.ownerDocument

Property attributes: