title: How to toggle div visibility using radio buttons?
body: <p>I'm working on a project in which I have to toggle the visibility of a <code>&lt;div&gt;</code>. </p>
  
  <p>I've got the following code:</p>
  
  <pre><code>&lt;input type="radio" name="type" value="1"&gt; Personal
  &lt;input type="radio" name="type" value="2"&gt; Business
  
  &lt;div class="business-fields"&gt;
      &lt;input type="text" name="company-name"&gt;
      &lt;input type="text" name="vat-number"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I would like to togle the business-fields div. So, if none of the radio buttons, or the 'personal' radio button is selected: The div should be hidden. If the 'business' radio button is selected, I want it to show.</p>
  
  <p>Currently, I am using this code:</p>
  
  <pre><code>$("input[name='type']").click(function() {
      var status = $(this).val();
      if (status == 2) {
          $(".business-fields").show();
      } else {
          $(".business-fields").hide();
      }
  });
  </code></pre>
  
  <p>However, I was wondering if I can do this using the .toggle() function.</p>