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

Update text in HTML

Status
Not open for further replies.

Rodie

Programmer
Jun 27, 2004
132
FR
Hi all :)

I have an HTML page. I would like to have a text that I can update whenever I want, like in a kind of label. This text has a particular style (color ...) so it cannot be in a textarea for example.

The only solution I found is to put this text in a <a id="mytext"></a> tag without any "href". But now, there is now property "value" or "text" to do something like this:
Code:
document.mytext.value = "text updated"

Someone has an idea ?
Thanks a lot :)
 
I found how to do that:
Code:
<div id="mydiv"><div>
...
mydiv.innerHTML = "mytext"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top