how to ancestor parentnode js code example Example: comment obtenir l'élément parent javascript var parent = document.getElementById("myElement").parentElement;