Suppose I have this HTML code:
<div class="person">
Mike Mulky
</div>
<div class="person">
Jenny Sun
</div>
<div class="person">
Jack Kickle
</div>
This JQuery thingy will actually filter the matching query. For example, when a user types in a textbox.
$('#userInputTextbox').keypress(function(){
$('div.person').hide().filter(':contains("'+THE_QUERY+'")').show();
});
This works! And it actually filters out the stuff. My question is: how do you highlight the words that appear in there (the query and the matching text in the DIVs)?