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!

variable label?

Status
Not open for further replies.

almoes

Programmer
Jan 8, 2003
291
US
Hi!

I would like to have a dynamic label, but I think that 'label' doesn't have a value attribute, right? What could be an alternative, via scripting?

thanxs,
alej
 
use div tag.
<head>
<script>
function Label()
{
//to change is dynamically assign different values.
document.getElementById(&quot;lbl&quot;).innerHTML=&quot;Hello&quot;
}
</script>
</head>
<input type=&quot;button&quot; name=&quot;AD&quot; value=&quot;Change Label&quot; onclick=&quot;Label()&quot;>
<div id=&quot;lbl&quot;>
</div>


HTH

Known is handfull, Unknown is worldfull
 
sorry, by dynamically I meant refresh it by code. Its a status label and would like to change its value by scripting, but I think that this line you wrote should work:

document.getElementById(&quot;lbl&quot;).innerHTML=&quot;Hello&quot;

right?

alej
 
yes it will. what value it must have is upto u...

Known is handfull, Unknown is worldfull
 
thanxs a lot! it works perfectly ;-))

cheers,
alej
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top