让jQuery的contains方法不区分大小写
// NEW selector  
jQuery.expr[':'].Contains = function(a, i, m) {  
  return jQuery(a).text().toUpperCase()  
      .indexOf(m[3].toUpperCase()) >= 0;  
};  
// OVERWRITES old selecor  
jQuery.expr[':'].contains = function(a, i, m) {  
  return jQuery(a).text().toUpperCase()  
      .indexOf(m[3].toUpperCase()) >= 0;  
};  
//该代码片段来自于: http://www.sharejs.com/codes/javascript/4289 
用法:
$("div:contains('John')") Test HTML:
<div>john</div> <div>John</div> <div>hey hey JOHN hey hey</div>
 
                    
                
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号