Javascript jQuery移动单选按钮onchange事件
我有一套单选按钮Javascript jQuery移动单选按钮onchange事件,javascript,jquery,html,jquery-mobile,radio-button,Javascript,Jquery,Html,Jquery Mobile,Radio Button,我有一套单选按钮 <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 t
<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>
更改事件没有触发,我似乎不知道为什么。dom就绪处理程序中有此代码吗?它在$(document.ready(function(){})中<代码>$(文档)。在(“更改”,“无线电选择-4”上,函数(事件,ui){不要在jqm中使用
.ready()
。检查演示。ready()现在更改为bind('pageinit',函数(事件)。但问题仍然没有解决。您使用的是jquery和jqm的哪些版本?
$("#radio-choice-4").bind( "change", function(event, ui) {
jQuery.mobile.changePage('#dialogCustom');
console.log('custom is selected');
});