I am currently using a catch all method for all inputs on my form when it is being handled by jQuery.
$.each($(':input'),function()
{
//stuff
});
What I need to be able to do is see if any of those inputs is a checkbox, at the moment the only thing I can find is to say if the field is checked or not.
Any help would be greatly appreciated.
If you want to know whether it’s a checkbox inside that function:
(Yeah, you can also say
$(this).attr('type')==='checkbox'if you’re one of those people who’re dead set on using jQuery syntax for everything. But really, what’s the point? It’s only going to be slower and less readable.)If you want to find only checkboxes, there’s a special filter for that: