How to get the type of input in the form by its name? for example:
<input type="text" value="123" name="username" />
the return type should be "text".
Any ideas?
How to get the type of input in the form by its name? for example:
<input type="text" value="123" name="username" />
the return type should be "text".
Any ideas?
<input type="text" value="123" name="username" id="username" />
getInputType("#username");
getInputType("input[name=username]");
function getInputType(selector){
var inputType = $(selector).attr('type');
alert(inputType);
return inputType;
}