change the URL for a Hyperlink using jQuery AVADHESH PATEL303108-Sep-2012jqueryjquery Updated on 18-Sep-2020
AVADHESH PATEL
08-Sep-20121- $("a").attr("href", "http://www.phpinterviewquestion.com/");
2- $("a[href='http://www.phpinterviewquestion.com/']")
.attr('href', 'http://phpinterviewquestion.com/');
3- $("a[href^='http://phpinterviewquestion.com']").each(function(){
this.href = this.href.replace(/^http:\/\/beta\.phpinterviewquestion\.com/,
"http://phpinterviewquestion.com");
});