title: changing the value of a variable when a radio button is clicked
body: <p>I know this is probably extremely simple to do but i cant't figure it out.All i need is for the value of the variable "price" to change when the radio button is click and for it to be displayed on the page.Thanks for the help.</p>
  
  <p>This is placed in the head</p>
  
  <pre><code>&lt;script&gt;
  var price = 500;
  if (document.getElementById('wifi').checked) {
  price = price + 200;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>This is placed in the body of the html page</p>
  
  <pre><code>&lt;input type="radio" name="wifi_price" id="wifi" value="200"&gt;Wifi Price&lt;/input&gt;
  &lt;script&gt;document.write(price);&lt;/script&gt;
  </code></pre>