开发者

How to get the selected value from a asp:DropdownList using jQuery

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'开发者_如何学JAVA).text());


       }).change();
   }


Use val() instead of text().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜