js判断checkbox是否选中并且显示隐藏相关实例
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>js判断checkbox是否选中并且显示隐藏相关实例</title>
<script language="javascript教程">
function check()
{
if( document.all['zt'].checked )
{
document.getElementById('gotourl_id').style.display='block';
}
else
{
document.getElementById('gotourl_id').style.display='none';
}
}
</script>
</head>
<body>
<table width="98%" border="0">
<tr>
<td>显示隐藏</td>
<td> <input name="zt" type="checkbox" id="zt" value="1" onclick="check();" /> </td>
</tr>
<tr id="gotourl_id" >
<td class="align_c"><strong>跳转地址:</strong></td>
<td ><input name="gotourl" type="text" id="gotourl" size="60" value="aaaaa" /></td>
</tr>
</table>
</body>
</html>
本站原创文章,转载的朋友注明来自www.111cn.net