i have dropdown-menu

i want trigger when selecting on 1 of option. i've tried
$.each(objects.assignments, function(index, value) { $('#group-' + index).click(function() { updateinfo(index); chart.draw(data[index], options); if ( index == 0 ){ $("#as-dd.dropdown").text('summary'); console.log("a"); } else{ $("#as-dd.dropdown").text('group ' + index); console.log("b"); } }); }); - i got no error in console.
- i got nothing display in console.
how trigger when selecting on 1 of option ?
am not suppose use .click() ?
any helps / suggestions on appreciated.
you not need .each() or .click(). use .change() method
$('select').on('change', function(){ var selectedvalue = $(this).val(); // based on selectedvalue can });
Comments
Post a Comment