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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change text in span 1

Status
Not open for further replies.

snowboardr

Programmer
Joined
Feb 22, 2002
Messages
1,401
Location
PH
I am having trouble changing text in a span could someone help me? Im really bad at JS... I will admit it ;)

Code:
<SPAN ID="SPAN"></SPAN>
<INPUT TYPE=BUTTON VALUE="Change text" ONCLICK="Text()">
<SCRIPT LANGUAGE="JavaScript">
function Text()
{document.getElementById("SPAN") = "New text";}
</SCRIPT>
 
>[tt]{document.getElementById("SPAN") = "New text";}[/tt]
[tt]{document.getElementById("SPAN")[red].innerHTML[/red] = "New text";}
[/tt]
 
thanks a bunch!!

Site San Diego www.sitesd.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top