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
Try this, it should highlight the whole string and words inside.
var searchterm = "Windows XP"; var tohighlight = searchterm.split(" "); tohighlight.push(searchterm); $("p,a").highlight(tohighlight);