P
Peter Michaux
Hi,
In the following snip of and HTML page, is there a specification
guarantee that the foo element will be parsed and available as part of
the DOM by the time the script executes? That is, could this error in a
standards-compliant browser?
<p id="foo">foo</p>
<script type="text/javascript>
var foo = document.getElementById('foo');
</script>
This seems to be very common practice. If this is not a standard then
perhaps this is a de facto standard that all browsers honour?
Thank you,
Peter
In the following snip of and HTML page, is there a specification
guarantee that the foo element will be parsed and available as part of
the DOM by the time the script executes? That is, could this error in a
standards-compliant browser?
<p id="foo">foo</p>
<script type="text/javascript>
var foo = document.getElementById('foo');
</script>
This seems to be very common practice. If this is not a standard then
perhaps this is a de facto standard that all browsers honour?
Thank you,
Peter