If you want to match an anchor with a specific existing href , you might use something like this:. So readers should just have a look at the post womble linked.
Would you like to answer one of these unanswered questions instead? Cooper Cooper 7,291 2 7 28. This example will change the second Google link in the content, but not the first one or the one in the footer:.
However, a summary here would be nice, otherwise this bit of information kinda gets lost.. In this case, if you already have jQuery injected, probably jQuery one look shorter and more cross-browser... Imagine you have this href below: Attr function since jQuery version 1. To change links in a given section, add the container div's class to the selector.
Thank you for your interest in this question. To change individual links regardless of where they fall in the document, add an id to the link and then add that id to the selector. Depending on whether you want to change all the identical links to something else or you want control over just the ones in a given section of the page or each one individually, you could do one of these. I not too pedantic about the down-vote, but if you 're not going to say why you are down-voting, there is nothing being achieved, and you shouldn't bother.
Use the attr method on your lookup.