Possible Duplicate:
How do I determine an HTML input element type upon an event using jQuery?
I want to get type of input object but I alway got "undefined".
What is missing it this code?
var c = $("input[name=\'lastName\']");
c.val("test");
alert(c.type);
My form
<form action="formAction.jsp" method="post">
FirstName <input type="text" name="firstName" id="firstName"></input><br/>
LastName <input type="text" name="lastName"></input><br/>
Address <input type="text" name="address"></input><br/>
Tel <input type="text" name="tel"></input><br/>
Email <input type="text" name="email"></input><br/>
</form>