Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

selectedindexchanged event of dropdownlist is not working with jquery

Tags:

jquery

asp.net

hello I have a dropdownlist. I am using jquery plugin to give style to dropdownlist. jquery plugin is jquery.dd.js. but my problem is selectedindexchanged event is not working in Internet exlorer 8 although it is working fine in other browsers.

like image 957
user851889 Avatar asked Jul 19 '11 11:07

user851889


2 Answers

try this:

$('#yourSelectId').change(function() {
    var selectedVal = $('#yourSelectId option:selected').attr('value');
});

you will get the value inside selectedVal

like image 184
kleinohad Avatar answered Nov 15 '22 06:11

kleinohad


Think would be better to use .val()

$('#yourSelectId').change(function() {
    var selectedVal = $('#yourSelectId').val();
});
like image 33
RizzCandy Avatar answered Nov 15 '22 06:11

RizzCandy