Last active
June 28, 2021 16:03
-
-
Save Alexander-Pop/e0728ad5b425e831495ff8f33aaa4b01 to your computer and use it in GitHub Desktop.
Jquery - onclick add parameter to url of other element #jquery #click
This file contains hidden or 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
$("#classdemo-about img").click(function(){ | |
//console.log('yes'); | |
$('.btn-primary').attr('href', function() { | |
var vpar = '?vid=1'; | |
if (this.href.indexOf(vpar) == -1) { | |
return this.href + vpar; | |
} | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment