title: Undefined value, reading an input
body: <p>i am geting undefined for ans . why? what is wrong?</p>
  
  <pre><code>function submitAnswer()
  {
  
  var myForm = document.getElementById('quiz');
  var ansVal = myForm.ans.value;
  var qnoVal = myForm.qno.value;
  
  alert ("ans="  + ansVal);
  alert ("qno = " +qnoVal);
  return;
  }
  
  &lt;form nam="quiz" id="quiz" &gt;
  Yes:
  &lt;input type="radio" id="ans"  name="ans" value="1"  /&gt;
  &lt;br /&gt;No:
  &lt;input type="radio" id="ans" name="ans" value="0"   /&gt;
  
  &lt;input id="qno" type="text" name="qno " value="qqq" /&gt;
  
  &lt;input type="button" value="" onClick="submitAnswer(); " /&gt;
  &lt;/form&gt;
  </code></pre>