Me parece que algo has hecho mal..
Bueno, con el permiso de
KarlanKas aqui te pongo el texto completo:
Código HTML:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
function comprobar()
{
f = document.forms[0];
for (a=0; a<f.elements.length; a++)
{
if (f[a].type == "checkbox")
{
f[a].style.visibility = (f[a].checked)?"hidden":"visible";
}
}
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<p>
<input type="checkbox" name="checkbox" value="checkbox">
</p>
<p>
<input type="checkbox" name="checkbox3" value="checkbox">
</p>
<p>
<input type="checkbox" name="checkbox2" value="checkbox">
</p>
<p>
<input type="button" name="Submit" value="Comprobar" onClick="comprobar()">
</p>
</form>
</body>
</html>
A mi me funciono.