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()
.
精彩评论