I am trying to make a <div> containing certain choices not show unless a certain other checkbox is chosen. I have this for the checkbox:
[CODE]<input type=”checkbox” onclick=”hideAll(1);” />
And this is the div that I want to not show unless the above is checked:
[CODE]
<div class=”secondLevel” id=”tb”>
Enter name:
<input type=”text” />
</div>
And here is the javascript:
[CODE]
function hideAll (val) {
if (val==”1″)
{
document.getElementById(‘tb’).style.display=’block’;
} else {
document.getElementById(‘tb’).style.display=’none’;
}
return true;
}
I am not very familiar with JS so I apologize if I have made a simple mistake and I appreciate any guidance.
Thanks,
Todd