Jquery .each(): find elements containing input
- by Poku
Hey,
I have a table which have a thead section and a tbody section. Im using jQuery each to find and count all THs in a table. This works fine. But at the same time i want to check if the TDs of the THs in the tbody is containing any input elements.
Here is what i have so far:
jQuery('#' + _target).each(function () {
var $table = jQuery(this);
var i = 0;
jQuery('th', $table).each(function (column) {
if (jQuery(this).find("input")) {
dataTypes[i] = { "sSortDataType": "input" }
}
else {
dataTypes[i] = { "sSortDataType": "html" }
}
i++;
});
});
I hope this is enough information for you to help me out?