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