title: Jquery get attribute ID for latest click
body: <p>im trying to get the attribute value through jquery</p>
  
  <pre><code>$(document).click(function() {                                    
              var elem = $("input[name='phone']");
              alert(elem.length);
              if(elem.length &gt; 0){
                    alert(elem.attr('id'));
                  }
              }); 
  </code></pre>
  
  <p>here the case is </p>
  
  <p>i have lots of input fields with same name as "phone" in different form. Whenever i click it i can get only the first value. Not the last one. How can i get it through the Jquery. </p>
  
  <p>In my page only document click will work because the form codes are loading from some other site. </p>
  
  <p>Any help is more appreciate </p>