JavaScript DOM

Creating elements

 

 

Parent element

document.getElementById('wrapper').parentElement.parentElement;

….

Get attribute of element

element.getAttribute(attribute_name)

The difference between parentElement and parentNode, is that parentElement returns null if the parent node is not an element node