Why is the variable used inside: contains () not working? Is there any way to make it work? filter('contains()')doesn't work either.
<h2>Test</h2>
<div>Test</div>
var model = $('h2').text();
$('div:contains(model)').css('background','yellow');
$('div:contains("Test")').css('background','yellow');
source
share