如何使jQuery包含不区分大小写的内容,包括jQuery 1.8+?
为了方便起见,在这里复制解决方案:
jQuery.extend(
jQuery.expr[':'], {
Contains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" });以下是错误:
Error: q is not a functionSource File: /js/jquery-1.4.js?ver=1.4Line: 81
这里是我使用它的地方:
$('input.preset').keyup(function() {
$(this).next().find("li").removeClass("bold");
var theMatch = $(this).val();
if (theMatch.length > 1){
theMatch = "li:Contains('" + theMatch + "')";
$(this).next().find(theMatch).addClass("bold");
}
});翻过高山走不出你
HUX布斯
慕勒3428872
相关分类