title: How can I check the radio button relative to a textbox?
body: <p>I'm trying to check in reference to the textbox selected, but when I change to other textbox  the first radio button stays checked! and I don't know how can I do to check the radio button according to every textbox.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p&gt;&lt;input type="text" /&gt; &lt;input name="radio" type="radio" value="val1"/&gt;&lt;/p&gt;
  &lt;p&gt;&lt;input type="text" /&gt;&lt;input name="radio" type="radio" value="val2"/&gt;&lt;/p&gt;
  &lt;p&gt;&lt;input type="text" /&gt;&lt;input name="radio" type="radio" value="val3"/&gt;&lt;/p&gt;
  &lt;p&gt;&lt;input type="text" /&gt;&lt;input name="radio" type="radio" value="val4"/&gt;&lt;/p&gt;
  &lt;script&gt;
  $("input").focus(function () {
  $('input:radio[name=radio]:nth(0)').attr('checked',true);
  
  });
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>