Skip to content

Instantly share code, notes, and snippets.

@carlosrojaso
Created May 14, 2014 20:56
Show Gist options
  • Save carlosrojaso/aa83e0e3348f200a6b59 to your computer and use it in GitHub Desktop.
Save carlosrojaso/aa83e0e3348f200a6b59 to your computer and use it in GitHub Desktop.
JS Placement
<!doctype html>
<html>
<head>
<script>
// Attempting to access an element too early will have unexpected results.
var title = document.getElementById( "hello-world" );
console.log( title );
</script>
</head>
<body>
<h1 id="hello-world">Hello World</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment