搜索高亮

var url = window.location.search,
      index = url.lastIndexOf('=') + 1,

      sub = url.substring(index),

      text = decodeURI(sub);

     results = result.replace(new RegExp(text,"g"), "<b style='color:#f00'>"+text+"</b>");

  

posted @ 2016-04-14 18:00  唸随爱  阅读(137)  评论(0编辑  收藏  举报