:contains() 内での変数の使用が機能しないのはなぜですか? それを機能させる方法はありますか?filter('contains()')
どちらも機能しませんでした。
<h2>Test</h2>
<div>Test</div>
var model = $('h2').text();
//variable doesn't work
$('div:contains(model)').css('background','yellow');
//obviously, string works
$('div:contains("Test")').css('background','yellow');