/gist:3ea2dd5a2d0fc6d0fcea Secret
Created
October 7, 2014 20:51
Onclick change url using jquery
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Test</title> | |
<script src="//code.jquery.com/jquery-1.10.2.js"></script> | |
<script> | |
$(function () { | |
$("a").click(function () { | |
var objHref = $(this).attr("href"); | |
if (objHref != "#") { | |
$(this).attr("href", objHref + "?ID=22"); | |
} | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<a href="##">Hello</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment