Enable input filed on radio button checked
<p>I have 2 radio buttons and 2 input fields. I want to associate a radio button with a input field. So only the selected radio buttons input field will enable and others are disabled. My html markuo is :</p>

<pre><code>                &lt;div&gt;
                 &lt;input type="radio" checked="checked" name="co" data-for="s" /&gt;
                 &lt;input type="text" id="s" /&gt; &lt;br /&gt;&lt;br /&gt;

                 &lt;input type="radio" name="co" data-for="u"/&gt;
                 &lt;input type="text" id="u" disabled="disabled" /&gt;
                &lt;/div&gt;
</code></pre>

<p>So currently first radio button is checked and its input field is enabled. How will i do this with using little amount of jquery code ?</p>

<p><strong>EDIT</strong></p>

<p>I tried this :</p>

<pre><code>$("input[type=radio][name=co]").bind({ change: function () { 
  if ($(this).attr("checked") == "checked")
     $("#" + $(this).attr("data-for")).removeAttr("disabled"); 
  else 
     $("#" + $(this).attr("data-for")).attr("disabled", "disabled"); 
  } 
 });
</code></pre>
