<script src="jquery_1.11.1_min.js"></script>
<script>
$(document).ready(function(){
$('div.d1').filter(function(){
return $(this).text() > 4;
}).css('background','red');
});
</script>
<div class="d1">2</div>
<div class="d1">3</div>
<div class="d1">4</div>
<div class="d1">5</div>
<div class="d1">6</div>