title: getElementById, radio buttons, and document.write();
body: <p>Radio buttons and JS suck. Ok now that I got that out of my system here is my problem: I finally got Javascript to acknowledge the radio button's value after reading <a href="https://stackoverflow.com/questions/1082588/getelementbyid-not-playing-nice-with-radio-buttons">getElementById not playing nice with Radio Buttons</a></p>
  
  <p>I can alert the value but document.write(); won't work?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function getRadioValue() {
  var y=document.getElementById('draftrequirement_2').value;
  document.write(y);
  return y;
  }
  
  window.onload = function() { alert(getRadioValue()); }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;input onchange="checkRadio()" type="radio" name="draftrequirement" value="na" id="draftrequirement_2" /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>