title: jquery focus event doesnt seem to be working properl
body: <p>Am trying to use the jquery focus event for handling the following:</p>
  
  <p>there are three criterion for search, i.e. Post code, city, radius. user can select a sinngle one and that is shown by the radio button.</p>
  
  <p>the requirement is that when a user clicks a text box , its corresponding radio button should get selected but that doesnt seem to be working properly.</p>
  
  <p>the jquery is as under:</p>
  
  <pre><code>$(".criteria input[type='text']").focus(function(){
      $(".criteria input[type='radio']").attr('checked', false);
  
      $(this).parent().find("input[name='SearchRange']").attr('checked',true);
  });
  </code></pre>
  
  <p>the html is as under</p>
  
  <pre><code>&lt;section class="row searchgroup criteria"&gt; 
                  &lt;section class="col-xs-12"&gt;
                      &lt;div class="fieldgroup"&gt;
                          &lt;input type="radio" name="SearchRange" id="PostalCode" /&gt;
                          &lt;label for="PostalCode"&gt;Postal Code&lt;/label&gt;
                          &lt;input type="text" id="PostalCodeTxt" placeholder="PostalCode" /&gt; 
                          &lt;div class="clear"&gt;&amp;nbsp;&lt;/div&gt; 
                      &lt;/div&gt;
  
                      &lt;div class="fieldgroup"&gt;
                          &lt;input type="radio" name="SearchRange" id="City" /&gt;
                          &lt;label for="City"&gt;City&lt;/label&gt;
                          &lt;input type="text" id="CityTxt" placeholder="City" /&gt; 
                          &lt;div class="clear"&gt;&amp;nbsp;&lt;/div&gt;
                      &lt;/div&gt;
  
  
                      &lt;div class="fieldgroup"&gt;
                          &lt;input type="radio" name="SearchRange" id="SearchRadius" /&gt;
                          &lt;label for="SearchRadius"&gt;Search Radius&lt;/label&gt;
                          &lt;input type="text" id="SearchRadiusTxt" placeholder="SearchRadius" /&gt; 
                          &lt;div class="clear"&gt;&amp;nbsp;&lt;/div&gt;
                      &lt;/div&gt;
                   &lt;/section&gt;
              &lt;/section&gt; &lt;!--searchgroup--&gt;
  </code></pre>
  
  <p>it works on first couple of times then no radio button is checked. any help is appreciated.</p>