jquery find and replace text, without element id

前端 未结 5 1718
鱼传尺愫
鱼传尺愫 2020-12-05 20:06

I\'m playing around with finding and replacing text.

The only problem I\'m having is finding a text string, that is not attached to an element with an ID. Otherwise

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-05 20:52

    You want the :contains() selector. http://api.jquery.com/contains-selector/

    $("*:contains('Original Text')").each(...);
    

提交回复
热议问题