Created
May 1, 2018 16:45
-
-
Save interactiveRob/cdbe4b5869cd40a41685928a7108e814 to your computer and use it in GitHub Desktop.
jQuery prevent all link clicks on a page
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
$('a').each(function(){ | |
$this = $(this); | |
$this.click(function(e){ | |
e.preventDefault(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use this function in the console to prevent all link clicks from reaching their target page. Useful for testing GTM