<?xml version="1.0" encoding="windows-1252"?>
<node id="600240" title="thezip's scratchpad" created="2007-02-15 11:36:33" updated="2007-02-15 06:36:33">
<type id="182711">
scratchpad</type>
<author id="212789">
thezip</author>
<data>
<field name="doctext">
A jQuery question:

&lt;p&gt;Given the following html, how can I get the contents of the div, jims_class, to show and hide depending upon the checked status of the mybox1 checkbox?&lt;/p&gt;

&lt;c&gt;

&lt;script&gt;
  if ($('#mybox1').attr('checked')) {
    $('.jims_class').show());
  }
  else {
    $('.jims_class').hide());
  }
&lt;/script&gt;

&lt;form&gt;
  &lt;input type="checkbox" name="mybox1" id="mybox1"&gt;
  &lt;input type="checkbox" name="mybox2" id="mybox2"&gt;
&lt;/form&gt;

&lt;div class="jims_class"&gt;
Conditionally show this text depending on the checked status of mybox1...
&lt;/div&gt;

&lt;/c&gt;</field>
</data>
</node>
