jQuery忽略大小写过滤dom内容
1 <input id='search' type="text" placeholder="Search..."> 2 <table id="downloads" class="table table-bordered table-hover" style="width:100%"> 3 <script> 4 // 重写jQuery语法 5 jQuery.expr[':'].Contains = function (a, i, m) { 6 return jQuery(a).text().toUpperCase() 7 .indexOf(m[3].toUpperCase()) >= 0; 8 }; 9 </script> 10 11 $('#search').on('keyup click', function () { 12 $('#downloads').DataTable().search($(this).val() 13 ).draw(); 14 });

浙公网安备 33010602011771号