我一次又一次地将风格应用到我们网站上的某个短语。有没有办法在页面上搜索该短语的实例并自动应用该样式?使用Javascript或jQuery将风格添加到页面上的短语
例子:
<div>
This is what you get from <span class="comp">Company Name</span>.
We do all kinds of things here at <span class="comp">Company Name</span>.
</div>
这么多副本:http://stackoverflow.com/questions/671574/highlight-text-in-html-with-javascript-jquery和http://stackoverflow.com/questions/119441/highlight-a-word -with-jquery和http://stackoverflow.com/questions/1230714/jquery-how-to-highlight-certain-words-with-jquery – 2009-12-08 03:53:05