0

I have the following code and it gives me the text but not the value. What is wrong and how do I fix it?

 function pageLoad() {
       $('#<%=dpEmploymentStatus.ClientID%>').change(function() {

       alert($('#<%=dpEmploymentStatus.ClientID%>' + ' option:selected').text());


       }).change();
   }

1 Answer 1

1

Use val() instead of text().

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.