jQuery find input type (but also for select)
You can do this (fiddle here), make some sort of easy to use plugin: $.fn.getType = function(){ return this[0].tagName == “INPUT” ? this[0].type.toLowerCase() : this[0].tagName.toLowerCase(); } And use it like this $(“.element”).getType(); // Will return radio, text, checkbox, select, textarea, etc (also DIV, SPAN, all element types) $(“.elList”).getType(); // Gets the first element’s type Which … Read more