Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get the parent node from child node

const myChildNode = document.querySelector("#childNodeId");
const parent = myChildNode.parentNode;
 
PREVIOUS NEXT
Tagged: #parent #node #child #node
ADD COMMENT
Topic
Name
9+2 =