Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to Update Text on Page not working 1

Status
Not open for further replies.

Kalisto

Programmer
Feb 18, 2003
997
GB
ok, Ive an asp.net page, with the following div element
Code:
<div id="customer_response_answer">
	<span>
		<br>
		<div id="tbAnswer" runat="server"></div>	</span>
</div>

I have a javascript function
Code:
<script language=JavaScript> function updateAnswer(txt){document.getElementById('tbAnswer').InnerText=txt;}</script>

When the function is called, the div does not update.

I have put an alert in, and the function is being called withte right text.
I have tried InnerHTML and innerText Property of the Div

Nothing seems to work,so what am I doing wrong?

Cheers

K
 
Hi

Pay attention to the letter cases. JavaScript is case sensitive.
Code:
function updateAnswer(txt)
{
  document.getElementById('tbAnswer').[red]i[/red]nner[red]HTML[/red]=txt;
}

Feherke.
 
Thanks, it was an upper case I in Inner :$

K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top