Skip to content

Instantly share code, notes, and snippets.

@hkneptune
Created September 29, 2020 10:00
Show Gist options
  • Save hkneptune/7ca34f2a04382f68f616ae68bf6cf2a7 to your computer and use it in GitHub Desktop.
Save hkneptune/7ca34f2a04382f68f616ae68bf6cf2a7 to your computer and use it in GitHub Desktop.
jQuery - Open All URLs In New Tab
jQuery(document).on('click', 'body a', function(e){
e.preventDefault();
var url = jQuery(this).attr('href');
window.open(url, '_blank');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment