javascript change innerhtml
Posted
by David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2010-02-12T20:11:01Z
Indexed on
2010/05/05
15:48 UTC
Read the original article
Hit count: 354
ok im new at javascript, but im trying to change the innerhtml of a div tag, heres my script and its not working:
<head>
<script type="text/javascript">
function var1() {
document.getElementById('test').innerHTML = 'hi';
}
window.onLoad = var1();
</script>
</head>
<body>
<div id="test">change</div>
</body>
it should work but for some reason its not, any help?
© Stack Overflow or respective owner