So, I have this between my head tags
The JavaScript is executed before the divs are in the DOM. The standard way to do something after the DOM is ready is to use jQuery's $(document).ready(function () { });
, but there are other ways as well.
The oldschool way is to use .
Here's a newer way (edit: put display:none
into CSS):
HTML:
hello
CSS:
.javascript_needed {display:none;}
JavaScript:
$(document).ready(function () {
$('.javascript_needed').show();
});