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
You can use a DOM3-attribute-selector (jQuery doc) to get all elements that contain a certain text in their href
attribute. It would look like
$('a[href*="example.com"]')
However, that might not be what you actually want - not only urls to that domain might contain this string. You might do something like begins-with:
$('a[href^="http://example.com"]')
but to get an exact and possibly more complex match, you don't get around a custom filter:
$('a[href]').filter( function() {
return this.hostname == "example.com";
// or check other properties of the anchor element
})