用标签更改收音机

时间:2014-11-03 16:26:30

标签: radio-button

我有这个问题,这个代码可以工作,但如果我把标签不起作用任何建议吗?

此代码工作;

<script>

function seleziona(idradiochk) {    
$("#"+idradiochk).attr('checked',true);

};

</script>


<fieldset data-role="controlgroup">
<input type='radio' name='radiocam' id='radiochoice2525' value='2525' />
<input type='radio' name='radiocam' id='radiochoice2524' value='2524' />
<input type='radio' name='radiocam' id='XXradio-choice-1066' value='XX1066' />
</fieldset>

<a onclick="seleziona('radiochoice2525');"  href="javascript:;">clicca</a>

此代码不起作用

<script>

function seleziona(idradiochk) {    
$("#"+idradiochk).attr('checked',true);

};

</script>

<fieldset data-role="controlgroup">
<input type='radio' name='radiocam' id='radiochoice2525' value='2525' /><label  for='radiochoice2525'>a</label>
<input type='radio' name='radiocam' id='radiochoice2524' value='2524' /><label  for='radiochoice2524'>b</label>
<input type='radio' name='radiocam' id='XXradio-choice-1066' value='XX1066' /><label for='XXradio-choice-1066'>c</label>
<input type="radio" name="radiocam" id="radiocam2"  checked="checked" value="0"  /><label for="radiocam2">d</label>
</fieldset>


<a onclick="seleziona('radiochoice2525');"  href="javascript:;">clicca</a>

没有标签工作白色标签不起作用......任何想法如何解决?

0 个答案:

没有答案