agentforsythe
09-05-2006, 05:32 PM
I'm really tearing my hair out, please help.
I have...
<div id ="chatPanel"></div>
I have a function in the <HEAD>:
<script>
function chatMessage(sender, message)
{
document.getElementByID("chatPanel").innerHTML+= "<b>" + sender + "</b> - " + message + "<br>";
}
</script>
When I call chatMessage("me","some stuff"), the javascript console informs me that document.getElementByID is not a function!
but...
<button onClick="document.getElementById('chatPanel').innerHTML+='BOOM!'">BOOM!</button>
appends to the div just fine when you click the button.
So confused, please help.
I have...
<div id ="chatPanel"></div>
I have a function in the <HEAD>:
<script>
function chatMessage(sender, message)
{
document.getElementByID("chatPanel").innerHTML+= "<b>" + sender + "</b> - " + message + "<br>";
}
</script>
When I call chatMessage("me","some stuff"), the javascript console informs me that document.getElementByID is not a function!
but...
<button onClick="document.getElementById('chatPanel').innerHTML+='BOOM!'">BOOM!</button>
appends to the div just fine when you click the button.
So confused, please help.