Highlight a word with jQuery

后端 未结 12 1388
粉色の甜心
粉色の甜心 2020-11-22 01:20

I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word "dolor" in this text:



        
12条回答
  •  误落风尘
    2020-11-22 01:51

    You need to get the content of the p tag and replace all the dolors in it with the highlighted version.

    You don't even need to have jQuery for this. :-)

提交回复
热议问题