Created
July 2, 2012 10:48
-
-
Save olimortimer/3032672 to your computer and use it in GitHub Desktop.
JS: jQuery Replace HREF Query String
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// www.website.com/page?id=100 | |
$('#pageLink').attr('href', $('#pageLink').attr('href').replace(/((\?|&)id\=)[0-9]*/, '$1' + '123')); | |
// www.website.com/page?id=123 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment