How to set the text of an Asp.net labe control using Java Script.
Posted on 2014-07-21
I have an Asp.net label control. I need to set the text of the control using Java Script. I know that I have to use document.getElementById, however I can't figure out how to do it. Can someone help me out? The value stored in the label control is a floating point number like 345.33
// Asp.net Label control in my Aspx Page.
<asp:Label ID="myLabel" runat="server" visible="true"></asp:Label>
// Now trying to set the text of the label control. My java script function that contains the line of code below,
// is at the top of my Aspx page.
document.getElementById("myLabel").innerHTML = 688