title: Uncaught TypeError: Cannot read property 'checked' of null index.html:24
body: <p>I'm newbie in JavaScript, i hope you can help me, as in topic, null property.</p>
  
  <pre><code>var add = document.getElementById('addition').checked;
  var subs = document.getElementById('substraction').checked;
  var multi = document.getElementById('multiplication').checked;
  var div = document.getElementById('division').checked;
  
  var result = 0;
      var x = parseInt(document.getElementById('firstNumber').value);
      var y = parseInt(document.getElementById('secondNumber').value);
  
  function calculator() 
  {
      if (add)
      {
          result = addition(x, y);
      }
      else if (subs)
      {
          result = substraction(x, y);
      }
      else if (multi)
      {
          result = multiplication(x, y);
      }
      else if (division)
      {
          result = division(x, y);
      };
  }
  
  
  &lt;fieldset&gt;
      &lt;legend&gt;Method&lt;/legend&gt;
      &lt;p&gt;&lt;label&gt;&lt;input type="radio" name="method" id="addition" /&gt;Addition&lt;/label&gt;&lt;/p&gt;
      &lt;p&gt;&lt;label&gt;&lt;input type="radio" name="method" id="substraction" /&gt;Substraction&lt;/label&gt;&lt;/p&gt;
      &lt;p&gt;&lt;label&gt;&lt;input type="radio" name="method" id="multiplication" /&gt;Multiplication&lt;/label&gt;&lt;/p&gt;
      &lt;p&gt;&lt;label&gt;&lt;input type="radio" name="method" id="division" /&gt;Division&lt;/label&gt;&lt;/p&gt;
  &lt;/fieldset&gt;
  
  &lt;input type="submit" value="Submit" onclick="calculator();" /&gt;
  </code></pre>
  
  <p>And them i got message 
  "Uncaught TypeError: Cannot read property 'checked' of null index.html:24
  (anonymous function)"</p>
  
  <p>Please help me.
  Greets!</p>