我有一组单选按钮
<fieldset data-role="controlgroup" data-type="horizontal">
<input type="radio" name="radio-choice" id="radio-choice-1" value="Boxing" />
<label for="radio-choice-1">Boxing</label>
<input type="radio" name="radio-choice" id="radio-choice-2" value="MMA" />
<label for="radio-choice-2">MMA</label>
<input type="radio" name="radio-choice" id="radio-choice-3" value="Kick-boxing" />
<label for="radio-choice-3">Kick-boxing</label>
<input type="radio" name="radio-choice" id="radio-choice-4" value="custom" />
<label for="radio-choice-4">Custom</label>
</fieldset>
当选择最后一个单选按钮(radio-choice-4)时,我想打开一个对话框。我的javascript:
$("#radio-choice-4").bind( "change", function(event, ui) {
jQuery.mobile.changePage('#dialogCustom');
console.log('custom is selected');
});
改变事件不会触发,我似乎无法弄明白为什么。