<input type=radio name=a onclick=show('checkbox')>a<input type=radio name=a onclick=show('text')>b<br>
<input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><br>
<input type=checkbox><input type=checkbox><input type=checkbox><input type=checkbox>
<script>
function show(obj){
for(i=0;i<document.all.tags("INPUT").length;i++){
document.all.tags("INPUT")[i].runtimeStyle.display=""
if(document.all.tags("INPUT")[i].type==obj)
document.all.tags("INPUT")[i].runtimeStyle.display="none"
}
}
</script>

解决方案 »

  1.   

    <input type="radio" name="aa" onClick="txt.style.display='';chk.style.display='none'">a
    <input type="radio" name="aa" onClick="txt.style.display='none';chk.style.display=''">b
    <p>
    <span id="txt" style="display:none">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    </span>
    <span id="chk" style="display:none">
    <input type="checkbox" name="c">
    <input type="checkbox" name="c">
    <input type="checkbox" name="c">
    <input type="checkbox" name="c">
    </span>
      

  2.   

    谢谢
    问题是<input type=checkbox>前面还有请选择XX 几个字,我也想隐藏请填入:<input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><input type=text><br>请选择:<input type=checkbox><input type=checkbox><input type=checkbox><input type=checkbox>
      

  3.   

    那还是用hazeline(砸死我)的方法比较好
      

  4.   

    字写成:
    <span id=txt1>请填入</span>
    <span id=chk1>请选择</span>
    与hazeline(砸死我)中写的类似加上一句
    onClick="txt.style.display='';txt1.style.display='';chk.style.display='none';chk1.style.display='none'">
      

  5.   

    to hazeline(砸死我) span在table中就没有效果了,怎么办?<table width="100%">
      <span id="chk" style="display:none">
      <tr>  
             <input type="checkbox" name="c">
    <input type="checkbox" name="c">
    <input type="checkbox" name="c">
    <input type="checkbox" name="c">
      </span>
    </table>  
      

  6.   

    <input type="radio" name="aa" onClick="txt.style.display='';chk.style.display='none'">a
    <input type="radio" name="aa" onClick="txt.style.display='none';chk.style.display=''">b
    <table width="100%" border=1>
    <tr><td>
    <span id="txt" style="display:none">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    <input type="text" name="t" value="">
    </span>
    <span id="chk" style="display:none">
    <input type="checkbox" name="c">
    <input type="checkbox" name="c">
    <input type="checkbox" name="c">
    <input type="checkbox" name="c">
    </span>
    </td></tr>
    </table>