function myFunction2() { var x = document.getElementsByClassName("menu-item-has-children")[0]; x.id="menu" }