Javascript examples for DOM:Element parentNode
Get parent node with parentNode
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// ww w .j a v a2 s . c om 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>