Click to See Complete Forum and Search --> : how can i get value from label control (using javascript)


lrrajesh
06-13-2005, 05:25 AM
how can i get value from label control of dotnet wsing javascript. i want to clear the contents of label control on the click of button.

can any one help


thanks

Oak
06-13-2005, 06:21 AM
Use: <variableName> = <formName>.getElementByID(<yourLabelID>).value

Let me know if it yealds results.

:)

lrrajesh
06-13-2005, 11:51 PM
hi oak,

it wont work.... but i found a way for it


var label=document.getElementById('lblVoucher');
label.innerHTML=''
this will set the label value to null


thanks

Oak
06-14-2005, 03:52 AM
I was just referring to the method to get the value of the label control.

Its good to see that you figured out that there was actually another step involved in clearing the contents ;)

Good job.

All the best!