title: How do i know which radio button Has been Selected using Jquery
body: <pre><code>&lt;input type="radio" id="radio1" name="rb1" value="no"&gt; No
  &lt;input type="radio" id="radio2" name="rb1" value="yes"&gt; Yes
  </code></pre>
  
  <p>when I say this <code>alert("Test =="+$('#radio1').attr('checked'));</code> I expect <code>false</code> because it's not checked but it returns <code>undefined</code>.</p>
  
  <p>What is the correct statement?
  Why am I getting <code>undefined</code>?</p>