title: jQuery onClick capture the id of the element
body: <p>i have many input fields like this</p>
  
  <pre><code>&lt;input type="radio" name="name" id="name" onchange="enableTxt()" /&gt; 
  </code></pre>
  
  <p>when i click this radio button i wanna capture the id of the radio input. i am using the following code</p>
  
  <pre><code>function enableTxt() {
      var id = $(this).attr("id");
      alert(id);
  }
  </code></pre>
  
  <p>Am getting this error</p>
  
  <pre><code>a.attributes is undefined
  </code></pre>