Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get parent element javascript

var parent = element.parentElement;
//OR
e.target.parentNode  //target parent

<div>
  <span onclick="this.parentElement.style.display = 'none';">x</span>
</div>
 
PREVIOUS NEXT
Tagged: #parent #element #javascript
ADD COMMENT
Topic
Name
7+8 =