Normally, if you need to change the text on an ASP.Net label, you would be doing it in your chosen language, being server side. But there are times when you are doing some functions in Javascript in which you need to change the text on an ASP.Net Label control using Javascript. It’s not as straightforward as it is in VB.Net or C#, but it’s still not that hard.

First, you need to get a reference to the label:


 var lbl = document.getElementById('<%  = YourLabelID.ClientID %>')

then, to change the text on that label, in your Javascript code, put this:


lbl.innerHTML = "Your new text goes here"