Jofsey
0
Q:

how get parent element javascript

var parent = document.getElementById("myElement").parentElement; 
3
document.body.parentNode; // Returns the <html> element
document.body.parentElement; // Returns the <html> element

document.documentElement.parentNode; // Returns the Document node
document.documentElement.parentElement; // Returns null (<html> does not have a parent ELEMENT node) 
1

New to Communities?

Join the community