title: Radio button onChange function
body: <p>I have a small problem. What is wrong with this function? I have no idea. I need pop-up  alert window when the radio button is selected. Thanks for every reply.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;input type="radio" name="radioButton" class="choice" value="1"&gt;
  &lt;input type="radio" name="radioButton" class="choice" value="2"&gt;
  &lt;input type="radio" name="radioButton" class="choice" value="3"&gt;
  </code></pre>
  
  <p>JavaScript</p>
  
  <pre><code>var FormFields =
  {
      init: function()
      {
  
          var radio = document.getElementsByName("radioButton");  
          radio.onchange = FormFields.showAlert;  
      },
      showAlert: function()
      {               
          alert("Bye!");
      },
  };
  </code></pre>