New to JavaScript. Found the following on this message board doing a search. Think I have read all 300+ messages about show/hide. This code works great, but I can’t figure out how to add sections. I have a form that I want to use multiple checkboxes to show/hide. This code shows the use of only one show/hide. Any suggestions how to add multiple options for the user going down a form?
Here’s the code I located from this board:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”
“
<html>
<head>
<script type=”text/javascript”>
function toggle(e, show) { e.style.visibility = show ? ‘visible’ : ‘hidden’ }
onload = function() { toggle(document.getElementById(‘info’), false) }
</script>
</head>
<body>
<script type=”text/javascript”>
document.write(‘<div><label for=”toggle”><input type=”checkbox” onclick=”toggle(document.getElementById(‘info’), this.checked)” id=”toggle”>Show/Hide</label></div>’);
</script>
<div id=”info” style=”visibility: visible”>This is some extra information.</div>
</body>
</html>