Open q2apro opened 6 years ago
Let's assume we have something like:
<h2>Fruit</h2> <ul> <li>Apple</li> <li>Pear</li> <li>Orange</li> </ul> <h2>Veggy</h2> <ul> <li>Cucumber</li> <li>Tomato</li> <li>Minions</li> </ul>
I'd use quicksearch on an input field like this (just example code including highlighting):
// search $("input#search").quicksearch("ul li", { noResults: '#noresults', stripeRows: ['odd', 'even'], loader: 'span.loading', onBefore: function() { $("ul li").unhighlight(); }, // remove former highlighting onAfter: function() { if($('#id_search').val()!='' && $('#id_search').val().length>1) { $("ul li:visible").highlight( $('#search').val() ); } }, });
Question is: How can I include the h2 into the quicksearch?
h2
The quicksearch only reads the li elements.
li
$("input#search").quicksearch("ul li, h2", ... should do the trick ?
$("input#search").quicksearch("ul li, h2", ...
Let's assume we have something like:
I'd use quicksearch on an input field like this (just example code including highlighting):
Question is: How can I include the
h2
into the quicksearch?The quicksearch only reads the
li
elements.