Find deepest child, :contains(string)

后端 未结 1 1237
忘了有多久
忘了有多久 2021-01-13 10:07

When I use the :contains selector, it returns all elements (including parents/ancestors) matching the selector. How can I just return the child-most/deepest

1条回答
  •  伪装坚强ぢ
    2021-01-13 10:25

    Try

    console.log($(':contains(Copyright):not(:has(*))'));
    

    Demo: Fiddle

    0 讨论(0)
提交回复
热议问题