title: How to connect radio buttons
body: <p>So I am trying to build a basic Federal Tax Calculator and I have built them all (Single/MFJ/HOH) separately but I am trying to combine them. I have built the radio buttons, here is the code for the buttons:</p>
  
  <pre><code>&lt;div id="status"&gt;
  &lt;input type="radio" id="Single" name="status" value="Single" checked="checked"&gt; Single
  &lt;input type="radio" id="MFJ" name="status" value="MFJ"&gt; Married Filing Jointly
  &lt;input type="radio" id="HOH" name="status" value="HOH"&gt; Head of Household
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my attempt at using them, but I can see the piece that is missing, the actual part where I would connect them to the code. How do I connect them? If someone could give me one example, I'm sure I could figure out the others. The following code is the taxes for a single filer, how would I connect the "single" button to the code?</p>
  
  <pre><code>&lt;body&gt;
      &lt;div id="GrossIncome"&gt;
    &lt;form name="GrossIncomeForm"&gt;
       &lt;input type="text" name="answer box" /&gt;
      &lt;button&gt;Calculate&lt;/button&gt;
     &lt;/form&gt;
    &lt;h4&gt;Taxes Paid: $&lt;span id="TaxesPaid"&gt;0.00&lt;/span&gt;&lt;/h4&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  
  document.querySelector('#GrossIncome form button').onclick = function(e) {
      e.preventDefault();
  
      var IncomeInput, TaxableIncome, TaxableIncomeAdjusted, TaxesPaid;
    IncomeInput = document.querySelector('#GrossIncome input').value;
    TaxableIncome = (IncomeInput.length) ? parseInt(IncomeInput, 10) : 0;
     TaxableIncomeAdjusted = TaxableIncome - 12000;
  
    if ( TaxableIncomeAdjusted &gt; 500000 )
  TaxesPaid = (TaxableIncomeAdjusted - 500000) * 0.37 + 150689.5;
    if ( TaxableIncomeAdjusted &lt;= 500000 )
  TaxesPaid = (TaxableIncomeAdjusted - 200000) * 0.35 + 45689.5;
    if ( TaxableIncomeAdjusted &lt;= 200000 )
  TaxesPaid = (TaxableIncomeAdjusted - 157500) * 0.32 + 32089.5;
     if ( TaxableIncomeAdjusted &lt;= 157500 )
  TaxesPaid = (TaxableIncomeAdjusted - 82500) * 0.24 + 14089.5;
     if ( TaxableIncomeAdjusted &lt;= 82500 )
  TaxesPaid = (TaxableIncomeAdjusted - 38700) * 0.22 + 4453.5;
    if ( TaxableIncomeAdjusted &lt;= 38700 )
  TaxesPaid = (TaxableIncomeAdjusted - 9525) * 0.12 + 952.5;
    if ( TaxableIncomeAdjusted &lt;= 9525 )
  TaxesPaid = TaxableIncomeAdjusted * 0.1;
  
  
    TaxesPaid = Math.max(TaxesPaid, 0).toFixed(2);
  
     document.querySelector('#TaxesPaid').innerHTML = TaxesPaid;
  };
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Thank you!</p>