title: Undefined error in Mozilla Firefox
body: <p>Why I'm getting undefined error in Firefox and IE. This code works well in Google Chrome. Here is the full code <a href="http://liveweave.com/fUhpiI" rel="nofollow">http://liveweave.com/fUhpiI</a></p>
  
  <p>this is my html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;link href="css/hpstyles.css" rel="stylesheet"&gt;
  &lt;script src="js/hpjs.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="hp"&gt;
      &lt;div&gt;
      &lt;h2&gt;1. Which one do you prefer?&lt;/h2&gt;
      &lt;div&gt;   
          &lt;input type="radio" name="q1" id="radio1" class="radio" value="9"/&gt;
          &lt;label for="radio1"&gt;Tea&lt;/label&gt;
      &lt;/div&gt;
      &lt;div&gt;   
          &lt;input type="radio" name="q1" id="radio2" class="radio" value="4"/&gt;
          &lt;label for="radio2"&gt;Coffee&lt;/label&gt;
      &lt;/div&gt;
      &lt;div&gt;   
          &lt;input type="radio" name="q1" id="radio3" class="radio" value="1"/&gt;
          &lt;label for="radio3"&gt;Milk&lt;/label&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div&gt;
      &lt;/br&gt;
      &lt;div&gt;&lt;div&gt;
      &lt;button type="button" onclick="hp(this.form)"&gt;Check&lt;/button&gt;
      &lt;input class="reset" type="reset" value="Reset"&gt;
      &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/form&gt;
      &lt;div id="result"&gt;&lt;/div&gt;
      &lt;div id="total"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>this is javascript</p>
  
  <pre><code>function hp(form)
  {
  var count1=0, count2=0, count3=0, count4=0, count5=0, count6=0, count7=0, count8=0, count9=0, count10=0,a ;
  for(var i=0;i&lt;3;i++){
  if (form.q1[i].checked === true)
  {
  count1++;
  }
  }
  if(count1!==1){
  alert("Please Answer 1st Question");
  return false;
  }
  answer1 = (form.q1.value);
  a=Math.floor(answer1);
  document.getElementById("result").innerHTML= "The selected values are "+"&lt;/br&gt;"+answer1;
  }
  </code></pre>