Camillia
asked on
Get the label name with Javascript/ASP.Net
This is related to the question i asked here but i closed that question:
https://www.experts-exchange.com/questions/22490183/Checking-for-length-of-strings-in-Javascript.html
I have a label with id="lblHPhone" and text="Home Phone"
I want to get the text and tried this:
var test = document.getElementById('< %= Page.Master.FindControl("C ontentPlac eHolder1") .FindContr ol("lblHPh one").Clie ntID %>');
alert(test.value);
But I get "undefined" for that...how can I get the label name??
https://www.experts-exchange.com/questions/22490183/Checking-for-length-of-strings-in-Javascript.html
I have a label with id="lblHPhone" and text="Home Phone"
I want to get the text and tried this:
var test = document.getElementById('<
alert(test.value);
But I get "undefined" for that...how can I get the label name??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Something like this:
<input type="text" name="lblHPhone" id="lblHPhone"> ?
Also ensure that there is only one element with the name lblHPhone