how to perform jQuery live filter on divs and not list items?
i am trying to filter outputted database entries where each entry has the following structure:
- <div class="class1 class2 class3" data-name="name" data-date="MM/DD/YY">
- <img src="path/to/image.jpg">
- <div class="class4">
- <h4>some text here</h4> <!-- this is what i want to search in -->
- <div class="class5">
- <span id="date">date: MM/DD/YY</span>
- <span id="id_one">text</span>
- </div>
- <div class="class6">
- <span id="id_two">text</span>
- <span id="id_three">text</span>
- </div>
- <span id="id_four">text</span>
- <span id="id_five"><a class= class7 href="path/to/link.html">link</a></span>
- </div>
- </div>
I am wanting to search within .class4 h4 and then fade out all .class1 divs that do not contain the searched for text.
so far most of the methods i have found only work with <li>'s or the 'parent' method of targeting the div to fade it out. this is not working in my implementation (everything is faded out) and i was wondering if there is a way to specifically define that any divs with .class1 that do not contain the searched for text fade out and then fade in when the search box is cleared.
thank you.