title: Show/hide a fieldset using jquery
body: <p>I have the following html code:-</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;body&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;
                  &lt;button&gt;
                      Show/Hide form
                  &lt;/button&gt;
              &lt;/legend&gt;
              Name:
              &lt;input type="text" /&gt;
              &lt;br /&gt;
              Email:
              &lt;input type="text" /&gt;
              &lt;br /&gt;
              Date of birth:
              &lt;input type="text" /&gt;
          &lt;/fieldset&gt;
  
          &lt;fieldset&gt;
              &lt;legend&gt;
                  &lt;button&gt;
                      Show/Hide form
                  &lt;/button&gt;
              &lt;/legend&gt;
              Name:
              &lt;input type="text" /&gt;
              &lt;br /&gt;
              Email:
              &lt;input type="text" /&gt;
              &lt;br /&gt;
              Date of birth:
              &lt;input type="text" /&gt;
          &lt;/fieldset&gt;
  
          &lt;fieldset&gt;
              &lt;legend&gt;
                  &lt;button&gt;
                      Show/Hide form
                  &lt;/button&gt;
              &lt;/legend&gt;
              Name:
              &lt;input type="text" /&gt;
                  &lt;br /&gt;
              Email:
              &lt;input type="text" /&gt;
                  &lt;br /&gt;
              Date of birth:
              &lt;input type="text" /&gt;
          &lt;/fieldset&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But how i can show and hide a field set if the user clicks on the "show/hide form"  button AND is there a way to change the button label to be either show or hide based on the current status of the field set?
  BR</p>