var test = $(".fleft").find("h2:contains('текст')").closest('div');
var test2 = test.parent();
$(test2).css('border', '3px solid red');
<div class="fleft">
<h2>Product 1</h2>
</div>
<div class="fleft">
<h2>Product 2</h2>
</div>
$(function () {
var blocks = $('.fleft').find('h2');
blocks.each(function () {
var parent = $(this).parent('.fleft');
if ($(this).text() == 'Product 1') {
parent.css('border', '3px solid red');
} else {
parent.hide();
}
});
});