In this case I want to test the div with class name
, but after testing I want the CSS changes to be made in the div with class teste
.
<div class="teste">
<div class="name">um nome</div>
<div class="outradiv">outra coisa</div>
</div>
$(".text").on('keyup', function (e)
{
$(".teste:contains('"+$(".text").val().toLowerCase()+"')").css("display", "block");
$(":not(.teste:contains('"+$(".text").val().toLowerCase()+"'))").css("display", "none");
});