0
In that case I want to test the div with class name
, but after testing I want the CSS changes to be made in 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");
});
If it is more than one div with the class
teste
, would work in the same way ??– Lucas Caresia
@Lucascarezia in this case may need an adjustment. The input is only 1 or there is an input per
.teste
?– Sergio
has only one input, and several
.teste
– Lucas Caresia
@Lucascarezia edited the answer to work with N
.teste
– Sergio
It didn’t work as well as I imagined, I’ll try to explain better, when you type anything that is in
.name
or.outradiv
I want you to share it with the class.teste
scram.– Lucas Caresia
@Lucascarezia this is even simpler. I will add to the answer.
– Sergio
@Lucascarezia in my code (second example) never refer
.outradiv
logic only takes into account the content of itself.teste
. Make a jsFiddle with this example that I can take a look at.– Sergio
I managed to solve the problem, I was just using uppercase letters, thank you.
– Lucas Caresia