Javascript examples for DOM:Element parentNode
Get nested parent HREF node
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*w w w. jav a 2 s. co m*/ var href = document.getElementById('some_div').parentNode; console.log(href) } </script> </head> <body> <a href="http://java2s.com"> <div id="some_div"> <span class="some_class"> <img src="http://www.java2s.com/style/download.png"> </span> </div> </a> </body> </html>