home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 February / PCWorld_2005-02_cd.bin / komunikace / slim / sbsetup.exe / Highlight.js < prev    next >
Text File  |  2003-06-08  |  295b  |  10 lines

  1. function Highlight(sKeyword,sColor)
  2. {
  3.     var range=document.body.createTextRange();
  4.     while (range.findText(sKeyword,100000,0))
  5.     {
  6.         var sHtml=range.htmlText;
  7.         sHtml="<span style=\"background-color: "+sColor+"\"><font color=#000000>"+sHtml+"</font></span>";
  8.         range.pasteHTML(sHtml);
  9.     }
  10. }