クラス「issueDropDown」でドロップダウンが動的に作成されるページがあります。クラス「issueDropDown」ですべてのドロップダウンのページをチェックして、それらが変更されたかどうかを確認しようとしています。基本的に、各ドロップダウン (無効になっている) の selectedIndex がまだ設定されている場合は、何かを実行します。
例:
<select class='issueDropDown'>
<option selected disabled>Select Type</option>
<option value="1">Type 1</option>
<option value="2">Type 2</option>
</select>
私がこれまでに持っていたものは機能していません(それぞれをチェックせずに):
$('body').on('change', '.issueDropDown', function() {
$('.issueDropDown').change(function(){
var selIndex = $(".issueDropDown").filter(function(){
return this.selectedIndex > 0;
}).length;
// I'll execute something here once I check that it's still "Select Type"
alert('test: ' + selIndex);
});