Never mind, I figured it out. Not exactly sure why but the statement :
Code:
document.getElementById("searchResultsP").innerHTML = $( ".english:contains(" + $searchTerm + ")" ).html();
was inserting a bunch of js code in the paragraph. The resolution was to do it in two steps, first get the search results in a variable and then insert the variable in the paragraph as shown below
Code:
var $searchResultsAlert = $( ".english:contains(" + $searchTerm + ")" ).html();
document.getElementById("searchResultsP").innerHTML = $searchResultsAlert;
Bookmarks