define(['app/lib/highlight'], function (highlight) { if ($("#searchresult").length){ var text = document.getElementById("search-term").innerHTML var words = text.split(' ') $('#searchresult').highlight(words) } });