I want to change the href of a link after I click on it:
$('#mylink').click(function() {
// do something
$('#mylink').attr('href', 'newURL.php');
});
<a href=# id=mylink>click</a>
i would assume this would work, but when I click on it, it redirects to new page.
How can I make it change the href after the user has finished clicking?