View Full Version : Javascript Checkbox Confirm

08-21-2011, 10:33 PM

I'm new to Javascript, but have been programming in PHP and other web codes for 4 years now.

I was wondering how you would check if a checkbox was ticked, upon its selection and then unhide HTML content, and then hide such content when deselected..

So far I have this:

<script type="text/javascript">
function Agree() {
document.getElementById("stepTwo").className = "";

Which is called by onclick="Agree()" on the select box itself..

I understand an if statement is needed, but how would one go about doing this as my if statements do not appear to be working.

08-21-2011, 10:47 PM
if (document.getElementById("mycheckbox").checked == true) {
} else {

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum