Getting the parent div of element

You’re looking for parentNode, which Element inherits from Node:

parentDiv = pDoc.parentNode;

Handy References:

  • DOM2 Core specification – well-supported by all major browsers
  • DOM2 HTML specification – bindings between the DOM and HTML
  • DOM3 Core specification – some updates, not all supported by all major browsers
  • HTML5 specification – which now has the DOM/HTML bindings in it

Leave a Comment

tech