I write something similar to the following code a lot. It basically toggles an element based on some condition.
In the following made-up example, the condition is \"
Ok, so I am an idiot and need to RTM before I ask questions.
jQuery.toggle() allows you to do this out of the box.
$("button").click(function() { var condition = $("#agree").is(":checked") && $("#name").val() != "" ); $("#mydiv").toggle(condition); });