首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

触发事件?解决办法

2012-02-26 
触发事件??我有3个复选框,一个输入框,inputtype radio name 1 value 1 inputtype radio na

触发事件??
我有3个复选框,一个输入框,
<input   type= "radio "   name= "1 "   value= "1 "   >
<input   type= "radio "   name= "a "   value= "2 "   >
<input   type= "radio "   name= "a "   value= "3 "checked>
<input   name= "b "   >
我点击输入框,那3个复选框就隐藏,如何实现

[解决办法]
<script language= "JavaScript " type= "text/javascript ">
<!--
function dis()
{
if (document.getElementById( "rd ").style.display== " ")
{
document.getElementById( "rd ").style.display = "none ";
}
else
{
document.getElementById( "rd ").style.display = " ";
}
}
//-->
</script>
</head>

<body>
<span id= "rd " style= "display: ">
<input type= "radio " name= "1 " value= "1 " >
<input type= "radio " name= "a " value= "2 " >
<input type= "radio " name= "a " value= "3 "checked>
</span>
<input name= "b " onclick= "dis(); ">
</body>

热点排行