Reputation: 6707
I am accessing head,
var head = document.getElementById("head");
Works with IE, not with Firefox..
Upvotes: 2
Views: 8122
Reputation: 5022
Tested on Firefox 3 with Firebug:
>>> document.getElementById('head')
<head id="head">
Are you sure your head element has an ID of head?
Upvotes: 0
Reputation: 24832
<html>
<head id="head">
<script type="text/javascript" src="jquery-1.3.1.min.js" ></script>
</head>
<body>
<script type="text/javascript">
alert(document.getElementById("head"));
</script>
</body>
</html>
work fine in firefox. but if you script is in the header and is runned automaticcally it could not work as the header is not fully loaded
Upvotes: 1