I’m running an .each() loop on all my form elements. I cannot find a way to determine the input type (whether it’s a checkbox, text, select, textarea etc…).
Any ideas?
// When submitting
$("input[name='event_form_submit']").click(function() {
$("form[name='tepg_form_processor'] :input").each(function() {
console.log($(this).attr("type"));
// Determine whether this is a select, input etc?
});
return false;
});
Try this (jsfiddle):