xai*_*ain 0 radio-button prototypejs
我有两套收音机:
<div class="form-row">
<div class="field-label">
<label for="part"><span class="style37">Participated</span></label><p class="aste">*</p>
<input type="radio" name="particip" id="particip-yes" value="on" checked> Yes
<input type="radio" name="particip" id="particip-no" value="off">No
</div>
</div>
<div class="form-row">
<div class="field-label">
<label for="trav"><span class="style37">Traveled?:</span></label>
<input type="radio" name="traveled" id="traveled-yes" value="on" checked>Yes
<input type="radio" name="traveled" id="traveled-no" value="off">No
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
当我点击参与号时,我需要选择旅行 - 否和禁用旅行 - 是和旅行号码.我试过了:
Event.observe('particip-no', 'click', function() {
$$('travel-no').checked=true
$$('travel-no').disabled=true
$$('travel-si').disabled=true
alert('no travel');});
Run Code Online (Sandbox Code Playgroud)
警报显示,但无线电没有变化.任何提示?谢谢.
如果你的ID选择你只是想$不$$
$('travel-no').checked=true;
$('travel-no').disabled=true;
$('travel-si').disabled=true;
Run Code Online (Sandbox Code Playgroud)
...假设id是正确的.顺便说一句,你错过了分号
| 归档时间: |
|
| 查看次数: |
8618 次 |
| 最近记录: |