Page 1 of 1

javascript prob

Posted: Tue Jul 29, 2003 6:39 am
by Denzo
can anyone tell me whats wrong with this script?

Code: Select all

<html>
<head>
<script language="javascript">
<!--
document.TEST_SPAN.innerHtml = "lalala<b>la</b>lalala";
// -->
</script>
</head>
<body>
Span it <SPAN ID="TEST_SPAN"></SPAN> 
</body>
</html>

thanks

Posted: Wed Jul 30, 2003 6:20 am
by patrikG
try deleting the underscore in "TEST_SPAN".
Once you've done that, use

document.getElementById("TESTSPAN").innerHtml="blabla";

Posted: Fri Aug 01, 2003 3:06 am
by tylerdurden
Just tested it. The underscore is fine. but you have to use document.getElementById.