I'm trying to highlight a searched terms which is working well. The problem is that I would like to avoid having 1 or 2 character words or "the" and 'and.'
if I use
var term = $('#q').val().split(/\s+/);
if(term.length < 3){
$('p').highlight(term);
}
it will take the input value as a whole string, so it has more then 3 letters.
so I guess I need to use
if(term:contains('and')){}
but the trick is how will I un-highlight that?