select all h2 in the dom with javascript code example Example: select all elements javascript var elements = document.getElementsByTagName("*");