How do you select a html tag for use with javascript? E.g. <script> // selects the H1 tags, that's all var h1 = document.h1; </script> Code (markup): <h1> hi </h1> HTML:
you can get the tags using 'getElementsByTagName' function. var firstHeadings = obj.getElementsByTagname("h1"); if (firstHeadings.length > 0) { myH1 = firstHeadings[0]; } Code (markup):