java file

Hey guys how to i get the inner text of a asp label for a javascript file?

i tried this in my java file:

var list = document.getElementById('<%= lblList.ClientID %>');

but not working?
Who is Participating?
eridanixConnect With a Mentor Commented:
var list = document.getElementById('someLabelId').innerText;

someLabelId is name of your ClientId in source code.
leakim971Connect With a Mentor PluritechnicianCommented:
var list = document.getElementById("<%= lblList.ClientID %>").innerHTML;
alert( list );
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.