The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
Retrieves the parent object in the document hierarchy.
Syntax
| JavaScript | |
|---|
Property values
Type: Object
the parent node.
Standards information
- Document Object Model (DOM) Level 1 Specification, Section 1.2
Remarks
The topmost object returns null as its parent.
Examples
This example assigns the parentNode of a span object to a variable.
<SCRIPT> var oParent = oSpan.parentNode; </SCRIPt> : <BODY> <SPAN ID=oSpan>A Span</SPAN> </BODY>
This example assigns the parentNode of a node, created with the createElement method, to a variable.
var oNode = document.createElement("B");
document.body.insertBefore(oNode);
var oParent = oNode.parentNode;
See also
- a
- abbr
- acronym
- address
- applet
- area
- attribute
- b
- base
- baseFont
- bdo
- bgSound
- big
- blockQuote
- body
- br
- button
- caption
- center
- cite
- code
- col
- colGroup
- comment
- dd
- del
- dfn
- dir
- div
- dl
- documentType
- dt
- em
- embed
- fieldSet
- font
- form
- frame
- frameSet
- head
- hn
- hr
- html
- i
- iframe
- img
- input type=button
- input type=checkbox
- input type=file
- input type=hidden
- input type=image
- input type=password
- input type=radio
- input type=reset
- input type=submit
- input type=text
- ins
- kbd
- label
- legend
- li
- link
- listing
- map
- marquee
- menu
- nextID
- object
- ol
- option
- p
- plainText
- pre
- ProcessingInstruction
- q
- s
- samp
- script
- select
- small
- span
- strike
- strong
- sub
- sup
- table
- tBody
- td
- textArea
- TextNode
- tFoot
- th
- tHead
- title
- tr
- tt
- u
- ul
- var
- xmp
- About the W3C Document Object Model
Send comments about this topic to Microsoft
Build date: 11/27/2012