title: How to get name of an input field using jQuery?
body: <p>Creating a plugin in jQuery, I have to get the names of input fields on which events would occur. </p>
  
  <p>Suppose: </p>
  
  <pre><code>&lt;input type="text" name="name" /&gt;
  &lt;input type="text" name="age" /&gt;
  </code></pre>
  
  <p>Whether submitted or not doesn't matter. What I want is to get the name of the field. </p>
  
  <p>I tried the following:</p>
  
  <pre><code>$('#ins').html($(this).attr('name').val());
  </code></pre>
  
  <p><code>#ins</code> is the div, where I am writing the events such as a <code>click</code> was made on the input with <code>name = name</code>. This way I want to create a plugin which would guide me to get to know which fields are getting some events.</p>