I know individual attributes can be retrieved with the attr() method, but I\'m trying to iterate over all of the attributes for an element. Fo
created this generic function that allows to look-in attributes as well as innearHtml:
function findByAll(toLookFor, lookInText) {
return $('*').filter(function() {
return Array.prototype.some.call(this.attributes, function(attr) {
return attr.value.indexOf(toLookFor) >= 0;
}) || (lookInText && $(this).text().indexOf(toLookFor) >= 0);
});
}