Find td with specific text, and operate on the td right after that one?

前端 未结 6 669
逝去的感伤
逝去的感伤 2020-12-19 04:13

I\'m not very familiar with jQuery selectors, so would like some help.

I have a table like this:

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-19 05:17

    jQuery has :contains() pseudo class :

    $('td:contains("Section Heading 4")').next().text(function(_,t){
        return t + ' Hello';
    })
    

    Be carefull, :contains is case sensitive.

提交回复
热议问题