I wanna to live search in page and filter match case. Because of that I use :contains
to search text in page. At first I want to find .col-3
that match with search text and after that I want to hide
other siblings element. Now I understand siblings()
not work correctly. It's a sample code:
$(document).ready(function(){
$(':text').on('change paste keyup',function(){
var val = $(this).val();
$('.col-3').css({'background':'#fff','color':'#000'});
if(val != ''){
var el = $('.col-3:contains('+val+')').css('color','blue');
el.siblings('.col-3').css('background','red');
}
})
})
What should I do?
This is Complete Code