Skip to content

Instantly share code, notes, and snippets.

@nola
Last active December 20, 2015 11:39
Show Gist options
  • Save nola/6124814 to your computer and use it in GitHub Desktop.
Save nola/6124814 to your computer and use it in GitHub Desktop.
Find a link on a page based on the href="", then replace it with another value.
$('a').each( function(i, ele){
if( !!ele.href.match("/site.com") ){
ele.href = ele.href.replace("site.com" , "staging.site.com" );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment