标签中指定字符串样式

背景:根据指定的字符串,搜索当前目录下所有的文件.

效果如下:

<pre>标签中指定字符串样式_第1张图片

高亮显示搜索条件.

$(function(){
        $("pre").each(function(i,item){            
            var text =$(this).html();
            text = text.replace('${searchParam}','<span style="color:Red">${searchParam}</span>');
            $(this).html(text);
        })
    })



你可能感兴趣的:(
标签中指定字符串样式)