Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
jQuery1.7.1を使用しています。filter(':contains( "XXX")')セレクターの大文字と小文字を区別しないようにする必要があります。私はこれを試しましたが、運が悪かったので、機能していません。正確には、$('div:contains')は機能しますが、filter(':contain')は機能しません
正規表現とフィルター関数を使用します。
yourJquerySet.filter(function(){ return $(this).text().match(/XXX/i) })
文字列XXXが動的に提供される場合は、
XXX
var r = new RegExp(str, 'i'); var outputset = inputset.filter(function(){ return $(this).text().match(r) })