javascript dom get element by id from parent code example Example: get parent id javascript var x = document.getElementById("ID").parentElement.nodeName;