<div id="la"> <div id="lol">g</div> </div> <script> lol = document.getElementById("lol"); alert(lol.parentNode + " " + lol.parentNode.id) </script>