"Advo" <ma**********@hotmail.comschreef in bericht
news:11**********************@m73g2000cwd.googlegr oups.com...
Is this Possible? ive got some code which works onclick and makes a div
visible.
onClick='document.getElementById("question11_comme nt").style.visibility
= "visible";'
Basically, either need a way to do on untick, or on second click. So
the first time they click the box it will make the div visible, and
then the 2nd time, it will make it hidden.
Any ideas please?
a sample:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css"<!--
..show{visibility: visible}
..hide{visibility: hidden}
--></style>
<script language="javascript" type="text/javascript">
//<![CDATA[
function showHidediv(strDivId, boolshowhide){
var styleSwitch;
if(boolshowhide) styleSwitch = "show";
else styleSwitch = "hide";
document.getElementById(strDivId).className = styleSwitch;
}
//]]>
</script>
</head>
<body>
<input type="checkbox" id="checkbox1" name="checkbox1"
onclick="showHidediv('thediv', this.checked)">
<div id="thediv" class="hide">abcdefg</div>
</body>
</html>