input - How do I hide a parent if div does not contain content? -
i have script matches user input filter , hide parents divs containing content.
i want use same script hide parent not contain inputed content.
i tried using :not no luck there... can't find ":notcontains"
what's correct syntax this?
this have...
html-
<div id='filter_a'> <span class='tags'>john john s john johns</span> </div> <div id='filter_a'> <span class='tags'>bob bob bobi bobi</span> </div> <div id='filter_a'> <span class='tags'>julie b julie julieb</span> </div>
script-
$("#b_submit").click(function() { var filter_text = $('input:text').val(); $('.tags:contains('+filter_text+')').parent().fadeout('slow');
ex: if user inputs "john", parents of bob , julie fadeout.
in sense, i'm looking proper version of:
$('.tags:doesnotcontain('+filter_text+')').parent().fadeout('slow');
Comments
Post a Comment