JavaScript: Difference between revisions

Content deleted Content added
Example script: Fixed incorrect information
Undid revision 494720306 by Derekleungtszhei (talk)
Line 300:
<script type="text/javascript">
document.write('Hello World!');
var h1 = document.getElementById("header"); // holds a reference to the element<h1> with an id of "header"tag
h1 = document.getElementsByTagName("h1")[0]; // accessing the firstsame <h1> element
</script>
<noscript>