ownerElement (W3C DOM Core property)
| Version | Depr. | Static | Read-only |
|---|---|---|---|
| DOM2 | No | No | Yes |
| IE7 | FF1.5+ | SA1.3+ | OP9+ |
|---|---|---|---|
| None | Full | Full | Full |
Example
var owner = node.ownerElement;
In the example above, if node is an Attr then the owner variable will be a
reference to the Element it belongs it.
So
in this example, if node were the
title attribute node, then owner
would be a reference to the <abbr> element that
contains it:
<abbr title="Big Friendly Giant">BFG</abbr>
Description
The Element node that an Attr node is
attached to; or null if it's not attached (for example,
if it's been created with createAttribute
but not yet added to an element).
This property is read-only.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 1.5 | 2.0 | 3.0 | 1.3 | 2.0 | 3.0 | 9.0 | 9.5 |
| None | None | None | Full | Full | Full | Full | Full | Full | Full | Full |
Internet Explorer does not implement this property (it returns undefined).
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.