title: How to get type of input object
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1940471/how-do-i-determine-an-html-input-element-type-upon-an-event-using-jquery">How do I determine an HTML input element type upon an event using jQuery?</a>  </p>
  </blockquote>
  
  
  
  <p>I want to get type of input object but I alway got "undefined". <br/>
  What is missing it this code?</p>
  
  <pre><code>var c = $("input[name=\'lastName\']");
  c.val("test");
  alert(c.type);
  </code></pre>
  
  <p>My form</p>
  
  <pre><code>&lt;form action="formAction.jsp" method="post"&gt;
      FirstName &lt;input type="text" name="firstName" id="firstName"&gt;&lt;/input&gt;&lt;br/&gt;
      LastName &lt;input type="text" name="lastName"&gt;&lt;/input&gt;&lt;br/&gt;
      Address &lt;input type="text" name="address"&gt;&lt;/input&gt;&lt;br/&gt;
      Tel &lt;input type="text" name="tel"&gt;&lt;/input&gt;&lt;br/&gt;
      Email &lt;input type="text" name="email"&gt;&lt;/input&gt;&lt;br/&gt;
  &lt;/form&gt;
  </code></pre>