JavaScript and client side scripting.
Moderator: General Moderators
-
Denzo
- Forum Newbie
- Posts: 21
- Joined: Sat Jun 21, 2003 4:01 am
Post
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
-
patrikG
- DevNet Master
- Posts: 4235
- Joined: Thu Aug 15, 2002 5:53 am
- Location: Sussex, UK
Post
by patrikG »
try deleting the underscore in "TEST_SPAN".
Once you've done that, use
document.getElementById("TESTSPAN").innerHtml="blabla";
-
tylerdurden
- Forum Commoner
- Posts: 66
- Joined: Mon Jul 28, 2003 11:52 am
- Location: Austria
Post
by tylerdurden »
Just tested it. The underscore is fine. but you have to use document.getElementById.