Forum Moderators: open
<form>
<input type="checkbox" name="C_Box" id="CBox1"> Click here if you are a new user!
</form>
If anyone can give me some ideas, I would really appreciate it. Thanks in advance....
luckydude
You need to toggle the visibility of a layer on and off with an onClick event. To do this you need to use a variable to flag whether the visibility is on or off:
<script type="text/javascript">
counter = 0;function show(layer) {
if(counter==0) {
document.getElementById(layer).style.visibility='visible';
counter=1;
}
else if(counter==1) {
document.getElementById(layer).style.visibility='hidden';
counter=0;
}
}
</script>
And in your HTML:
<input type="checkbox" onclick="show('layer1');">
<div id="layer1">
Hi There!
</div>
HTH