I can't seem to get getElementById to work when
I create an element in an external js file.
example...
[CODE=javascript]function blah(){
var temp=createElem ent("input");
temp.id = "stuff";
document.append Child(temp); }[/CODE]
my html page...
[HTML] <script> window.onload = blah; </script>
<script> document.getEle mentById('temp' ).value = "HELLO"; </script>
[/HTML]
result,
I see the input field in the webpage, but not the value.
I create an element in an external js file.
example...
[CODE=javascript]function blah(){
var temp=createElem ent("input");
temp.id = "stuff";
document.append Child(temp); }[/CODE]
my html page...
[HTML] <script> window.onload = blah; </script>
<script> document.getEle mentById('temp' ).value = "HELLO"; </script>
[/HTML]
result,
I see the input field in the webpage, but not the value.
Comment