title: jQuery currently checked radio button value shows always first button value
body: <p>I have a javascript like below:</p>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;li&gt;
  &lt;input type="radio" class="gal_location" name="gal_location" value="0"&gt; All
  &lt;/li&gt;
  &lt;li&gt;
  &lt;input type="radio" name="gal_location" class="gal_location" checked="checked" value="11"&gt;Sivasagar&lt;/li&gt;
  &lt;li&gt;
  &lt;input type="radio" name="gal_location" class="gal_location" value="3"&gt;Guwahati&lt;/li&gt;
  &lt;li&gt;&lt;input type="radio" name="gal_location" class="gal_location" value="9"&gt;Jorhat&lt;/li&gt;
  
  &lt;script&gt;                        
  if($('.gal_location').is(':checked')) { 
      var location_id = $("input:radio[name=gal_location]").val();     
  }
  alert('Location id is '+location_id);
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Now I expect to get an alert of <code>Location id is 11</code>,but instead I am getting an alert of <code>Location id is 0</code></p>
  
  <p><a href="http://jsfiddle.net/pb3tQ/" rel="nofollow">Code sample JSFiddle</a></p>