Js部分:
//关键字searchkey var regExp = new RegExp(searchkey, "g"); v1.cate_name=v1.cate_name.toString().replace(regExp, "<span style='color:red' >"+searchkey+"</span>");
PHP部分:
<?php echo str_replace($searchkey,"<span style='color:#f00'>".$searchkey."</span>",$vo1['cate_name']);?>