Quick way to use checkbox to show/hide a div
The following code illustrates a simple show/hide feature, based on status of a checkbox. The checkbox calls it onClick.
[code language=”javascript”]
myShowHideFunc = function(obj){
var displayMode = (obj.checked)?"none":"inline";
var focusobj = $("#DivToToggle");
$(focusobj).css({‘display’:displayMode});
}
[/code]
I draw your attention to the displayMode variable which is set by the if-then switch to a language that the jQuery css command can understand.