The parentElement Property


The parentElement Property

The parentElement property returns the parent element of the present element. Unlike the parentNode property, you only use this property with elements, not any kind of node. (Nodes can include text nodes, attribute nodes, and so on.) You can see the support for this property in Table 5.43.

Table 5.43. The parentElement Property

Property

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

parentElement

           

x

x

x

x

 

Read-only

 

Type: Object

Here's an example:

 var parentElement = document.getElementById("element1").parentElement 


Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net