Is it possible to grab a link by its href if it doesn't have a class or ID?

后端 未结 10 1041
北恋
北恋 2021-01-07 08:56

I\'m using someone else\'s app and want to change the innerHTML in between any < a>< /a> tag that has a certain href. But these links don\'t have a class or ID associa

10条回答
  •  庸人自扰
    2021-01-07 09:19

    Try this

    $('a[href*="example.com"]');
    

    This will select the link that has example.com in the href attribute..

提交回复
热议问题