我正在尝试使用Rhodes应用程序中的代码。在选择“标题”时,应检查相应的“性别”。我试过下面的代码,但它没有用。
<fieldset data-role="controlgroup" data-type="horizontal" class="title">
<legend>Title</legend>
<input name="title" id="radio-choice-h-2a" value="Mr." type="radio">
<label for="radio-choice-h-2a">Mr.</label>
<input name="title" id="radio-choice-h-2b" value="Mrs." type="radio">
<label for="radio-choice-h-2b">Mrs.</label>
<input name="title" id="radio-choice-h-2c" value="Ms." type="radio">
<label for="radio-choice-h-2c">Ms.</label>
</fieldset>
<fieldset data-role="controlgroup" data-mini="true" class="gender">
<legend>Gender</legend>
<input name="gender" id="radio-choice-v-6a" value="Male" type="radio">
<label for="radio-choice-v-6a">Male</label>
<input name="gender" id="radio-choice-v-6b" value="Female" type="radio">
<label for="radio-choice-v-6b">Female</label>
</fieldset>
我正在使用以下脚本:
<script>
$(document).ready(function() {
$('#radio-choice-h-2a').change(function() {
alert("in radio chenge")
if($('#radio-choice-h-2a').is(':checked')) {
alert("in radio Mr. is checked")
$('#radio-choice-v-6a').prop("checked", true);
}
});
});
</script>