To change the href for a hyperlink using jQuery you can use the following snippet.
The following example will change every href to https://codesnippets.fesslersoft.de.
Sample jQuery
$("a").attr("href", "https://codesnippets.fesslersoft.de/")
if you want to change every href pointing to https://codesnippets.fesslersoft.de with a href pointing to https://codesnippets.fesslersoft.de/change-the-href-for-a-hyperlink you can use the following snippet.
Sample jQuery
$("a[href^='https://codesnippets.fesslersoft.de/']")
.each(function()
{
this.href = this.href.replace("https://codesnippets.fesslersoft.de/", "https://codesnippets.fesslersoft.de/change-the-href-for-a-hyperlink");
});
RT @CodeSnippetsNET: How to change the href for a hyperlink http://t.co/94o4DestpP #jquery #js #javascript #php
RT @CodeSnippetsNET: How to change the href for a hyperlink http://t.co/94o4DestpP #jquery #js #javascript #php