jQuery.expr[':'].Contains = function(a, i, m) { return jQuery(a).text().toUpperCase() .indexOf(m[3].toUpperCase()) >= 0;
};
jQuery.expr[':'].contains = function(a, i, m) { return jQuery(a).text().toUpperCase() .indexOf(m[3].toUpperCase()) >= 0;
};With this in place,
$("div:contains('John')")would select all three of these elements:
<div>john</div>
<div>John</div>
<div>hey hey JOHN hey hey</div>Demo via Pablo Fortes.