I\'m trying to highlight search terms but it doesn\'t split the words. Two words take as a one string and highlights only the string as is.
In the demo you can see that
Supposing you get your string with
var s = $('#myInput').val();
do
s.split(' ').forEach(function(token){ $('p,a').highlight(token); });
or
$("body p").highlight(s.split(' '));