Tuesday, March 3, 2009

Changing or hiding HTML label texts

If you are doing a simple javascript program and want to change the text inside a label (or hide it, maybe?) you can do it by this simple code:
document.getElementById("whatever_your_label_id_is").innerHTML 
= "Text you want"

So now you can hide/show labels, change texts etc on the fly.

2 comments: