Dom 如何将事件绑定到jquerymobile中的多个selectmenu更改
我想在jquerymobile中完成选择后刷新我的页面。现在我在标记中使用onchange属性。这是我的代码Dom 如何将事件绑定到jquerymobile中的多个selectmenu更改,dom,jquery-mobile,Dom,Jquery Mobile,我想在jquerymobile中完成选择后刷新我的页面。现在我在标记中使用onchange属性。这是我的代码 <div data-role="fieldcontain" style = "background-color:white;border-bottom:1px solid #ccc"> <label for="select-choice-1" class="select">select specity:</label> <sele
<div data-role="fieldcontain" style = "background-color:white;border-bottom:1px solid #ccc">
<label for="select-choice-1" class="select">select specity:</label>
<select name="select-choice-1" id="select-choice-1" data-native-menu = false multiple=true onchange = "selectChange()"></select>
</div>
$("#select-choice-1").empty();
for (var i = 0; i < item.tagClassList.length; i++) {
if (item.tagClassList[i].isSelected) {
$("#select-choice-1").append("<option value="+item.tagClassList[i].id+"checked = true>"+item.tagClassList[i].className+"</option>");
} else {
$("#select-choice-1").append("<option value="+item.tagClassList[i].id+">"+item.tagClassList[i].className+"</option>");
}
if (i == item.tagClassList.length-1) {
$("#select-choice-1").selectmenu("refresh");
};
};
选择种类:
$(“#select-choice-1”).empty();
对于(变量i=0;i
但是每当选择或取消选择时,selectmenu()事件都会触发。我如何才能在selectmenu关闭时触发该事件
这也考虑了旧版本的ios,它们似乎不会在多个选择上触发更改事件
$('document').on('blur', '#select-choice-1', function(){
//run your check here
});