Opening All External URLs In New Tabs

Open External Links in New Tab

There are a few methods of setting links to different websites open in a new tab. Here’s a simple jQuery snippet I wrote that filters through <a> elements and sets each one’s attribute to _blank (new tab) if the link’s domain differs from the current domain

© 2019 – TonyCiccarone.com | PHP, WordPress, Laravel Development