Possible Duplicate:
How to change the href for a hyperlink using jQuery
I have an anchor tag for which the href=”” like so
<a class="SwitchAccountLink" href=""></a>. I want to override this using jQuery and provide a different href. Is it possible to override the inline href of an anchor tag?
Thanks in advance.
You can use jQuery’s
.attr()function to modify specific attributes of your elements.This code will replace all anchor tags with the
SwitchAccountLinkclass withNEW_URL.If you want to only change specific links, you might have to provide a more unique
idattribute or an additional class that groups all the links.