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

后端 未结 10 856
北恋
北恋 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:32

    you can do it with jquery: http://api.jquery.com/attribute-equals-selector/

    ex: linksToGoogle = $('a[href="http://google.com"]');

提交回复
热议问题