radio控制显示隐藏(转)
<!---- NO.1 简单的显示隐藏 ------> <script> function senfe_id(sid) { id_body.style.display=sid; } </script> <input type=radio name=SaveType value=1 checked onpropertychange="senfe_id('none');"> 隐藏 <input type=radio name=SaveType value=2 onpropertychange="senfe_id('');"> 详细 <div id=id_body style="display:none;"> 内容 <input name="StartID" type="text" size="6" maxlength="6"> </div> <!---- NO.2 radio变换图片 ------> <script> function imgsrc(src,imageid){ document.getElementByIdx(imageid).src = src; } </script> <table> <tr> <td width="300" height="50"> <input type="radio" name="radio1" value="/articleimg/bbsimg/icon1.gif" onclick="imgsrc(this.value,'img1');">a <input type="radio" name="radio1" value="/articleimg/bbsimg/icon2.gif" onclick="imgsrc(this.value,'img1');">b <input type="radio" name="radio1" value="/articleimg/bbsimg/icon3.gif" onclick="imgsrc(this.value,'img1');">c <input type="radio" name="radio1" value="/articleimg/bbsimg/icon4.gif" onclick="imgsrc(this.value,'img1');">d </td> <td id="tupian" width="150" bgcolor="fff000"> <img border="0" src="/articleimg/bbsimg/icon10.gif" id="img1"></td> </tr> <tr> <td width="300" height="50"> <input type="radio" name="radio2" value="/articleimg/bbsimg/icon5.gif" onclick="imgsrc(this.value,'img2');">A <input type="radio" name="radio2" value="/articleimg/bbsimg/icon6.gif" onclick="imgsrc(this.value,'img2');">B <input type="radio" name="radio2" value="/articleimg/bbsimg/icon7.gif" onclick="imgsrc(this.value,'img2');">C <input type="radio" name="radio2" value="/articleimg/bbsimg/icon8.gif" onclick="imgsrc(this.value,'img2');">D </td> <td id="tupian1" width="150" bgcolor="e2e2e2"> <img border="0" src="/articleimg/bbsimg/icon10.gif" id="img2"></td> </tr> <tr> <td width="300" height="50"> <input type="radio" name="radio3" value="/articleimg/bbsimg/icon9.gif" onclick="imgsrc(this.value,'img3');">E <input type="radio" name="radio3" value="/articleimg/bbsimg/icon10.gif" onclick="imgsrc(this.value,'img3');">F <input type="radio" name="radio3" value="/articleimg/bbsimg/icon11.gif" onclick="imgsrc(this.value,'img3');">G <input type="radio" name="radio3" value="/articleimg/bbsimg/icon12.gif" onclick="imgsrc(this.value,'img3');">H </td> <td id="tupian3" width="150" bgcolor="efefef"> <img border="0" src="/articleimg/bbsimg/icon10.gif" id="img3"></td> </tr> </table>