title: jQuery 1.8 Get selected value from radion button group
body: <p>I have a radio button group on my page:</p>
  
  <pre><code>1&lt;input type="radio" name="greeting" value="1"/&gt;
  2&lt;input type="radio" name="greeting" value="2"/&gt;
  3&lt;input type="radio" name="greeting" value="3"/&gt;
  4&lt;input type="radio" name="greeting" value="4"/&gt;
  5&lt;input type="radio" name="greeting" value="5"/&gt;
  </code></pre>
  
  <p>I have some code to get the selected value from this group:</p>
  
  <pre><code>$(document).ready(function () {   
  $("#btnAddEval").click(function () {
      $.fn.AddEval();
  }).hover(function () {
      $(this).addClass("addOver");
  }, function () {
      $(this).removeClass("addOver");
  });
  </code></pre>
  
  <p>});</p>
  
  <pre><code>jQuery.fn.AddEval = function () {
  $("#dvMsg").hide();
  $("#dErr").hide();
  var agent = $("#selAgent option:selected").text();
  
  if (agent == '(Select Agent)') {
      $("#divErr").show();
      return;
  }
  
  var gretting = $("input:radio[name=greeting]:checked").val();
  var greetingcmt = $("#txtGreeting").val();
  $("#dvMsg").show();
  </code></pre>
  
  <p>};</p>
  
  <p>This is the way that the jQuery <a href="http://api.jquery.com/val/" rel="nofollow">documentation</a> shows to get this value. When I test this and select any of the 5 button I always get greeting = "". I cannot seem to retrieve the value.</p>