0
<script>
$(document).ready(function() {
$("#select-native-1 option:selected").select(function() {
alert("a");
});
});
</script>
...
<form>
<div class="ui-field-contain">
<select name="select-native-1" id="select-native-1">
<option id="burnabyCampus" value="1">A</option>
<option id="downtownCampus" value="2">B</option>
</select>
</div>
</form>
我想從jQuery Mobile中聽選項選擇事件。但我不知道這樣做的正確方法?我在哪裏可以找到它?如何聽jquery移動事件?
到目前爲止我的問題是什麼?
謝謝。我沒有提到的一件事是,默認情況下,jQuery Mobile基本選擇已經選擇了第一個選項 - 或者至少看起來似乎。你可以聽選擇頁面加載事件嗎? (默認選擇) –
已更新,您應該接受答案 – chrismillah
並且有更改的api文檔()?找不到 –