//Highlight the searched keywords
function HeightLight (Keyword)
{
//Text selector
var TextRange;
//Whether it is found
var Found=false;
//Number of times found
var Count = 0;
TextRange = document.body.createTextRange();
Found = TextRange.findText(Keyword);
if (Found)
{
Count ;
}
while (Found && Count > 0)
{
TextRange.pasteHTML('' Keyword '');
//Will The scroll bar is positioned within the viewport range found for the first time
if(Count==1)
{
TextRange.scrollIntoView();
}
//Continue searching
Found = TextRange.findText(Keyword);
if (!Found)
{
Count = 0;
}
else
{
Count ;
}
}
}
//Regular expression method
function highLight(ele,keys)
{
var reg = new RegExp("(" keys.replace(/,/, "|") ")","g");
ele.innerHTML = ele.innerHTML.replace(reg,"$1");
}