简介:highlightRegex是一个jQuery插件,可以突出高亮文档文本的正则表达式。
jQuery高亮文本插件highlightRegex图片预览
jQuery高亮突出文本插件highlightRegex浏览器适配
- 支持Chrome所有版本
- 支持Firefox所有版本
- 支持Safari所有版本
- 支持IE8及以上版本
jQuery突出高亮文本插件highlightRegex使用教程
明确强调,$('#any.jquery.selector').highlightRegex();
如果你想用一种不同的标签和/或类,使用
1 2 3 4 | $( '#jquery.selector' ).highlightRegex( /some ([rR]egex)/,{ tagType: 'strong' , className: 'andHale' }); |
额外的属性,可以设置创建的标签
1 2 3 | $( '#jquery.selector' ).highlightRegex( /some ([rR]egex)/,{ attrs: { 'data-color' : 'blue' } }); |
查看更多