M
Martin Honnen
Börni wrote:
Well if it gives null it does work too, it just means no element with
that id can be found, presumably as the script is called somewhere
before the element is parsed e.g.
<script type="text/javascript">
alert(document.getElementById("edit"));
</script>
<div id="edit">...</div>
I'm just wondering why one cant do something like this outside of an
function:
alert(document.getElementById("edit"));
this just gives null, but inside a function it works.
Well if it gives null it does work too, it just means no element with
that id can be found, presumably as the script is called somewhere
before the element is parsed e.g.
<script type="text/javascript">
alert(document.getElementById("edit"));
</script>
<div id="edit">...</div>