Skip to content

Instantly share code, notes, and snippets.

@hodbby
Created May 29, 2012 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hodbby/2823244 to your computer and use it in GitHub Desktop.
Save hodbby/2823244 to your computer and use it in GitHub Desktop.
<html>
<head><title>simple page</title></head>
<body>
<h1 id="header">This is JavaScript</h1>
<script type="text/javascript">
document.write('Hello World!');
var h1 = document.getElementById("header"); // holds a reference to the <h1> tag
h1 = document.getElementsByTagName("h1")[0]; // accessing the same <h1> element
</script>
<noscript>
Your browser either does not support JavaScript, or has JavaScript turned off.
</noscript>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment