<form name="form1" method="post" action="">
<input name="radiobutton" type="radio" value="0" checked
onclick="form1.select1.style.display='';form1.select2.style.display='none';">
11
<input type="radio" name="radiobutton" value="1"
onclick="form1.select2.style.display='';form1.select1.style.display='none';">
22
<select name="select1" style="display:yes">
<option value="0" selected>11111</option>
<option value="1">2222</option>
</select>
<select name="select2" style="display:none">
<option value="3" selected>33333</option>
<option value="4">44444</option>
</select>
</form>
博客展示了一个HTML表单,包含两个radio button,点击不同的radio button会控制两个select下拉框的显示与隐藏。通过设置onclick事件,实现了表单元素间的交互效果。
3163

被折叠的 条评论
为什么被折叠?



