How to Make Automatically Open All Links in New Tab with Javascript | Droidnur123

Automatic Links Open in New Tab is an option when in a blog using links. The link itself is marked by the "a" tag which contains a certain address (UR
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated
Automatic Links Open in New Tab is an option when in a blog using links. The link itself is marked by the "a" tag which contains a certain address (URL) which can be another blog's address, the address of a post, an image address, or even a special address in the blog itself. In general, the link open in a new tab is intended to open a new address outside the blog.
How to Make Automatically Open All Links in New Tab with Javascript | Droidnur123


Benefits Of Automatically Open All Links in New Tab with Javascript?


The use of javascript allows links to open in a new tab applies to all existing links on the blog. So when we add this new tab automatic function via javascript, then bloggers no longer need to create a manual link function via HTML code because automatically all links have been set to open in a new tab.

How To Make Automatically Open All Links in New Tab with Javascript?

As Usual Login to Blogger > Then Click Themes > Then Click on Edit HTML After The customize button > Find the code </body> Copy and add the javascript below before the code </body> Tag

<script type="text/javascript">
//<![CDATA[
function externalLinks(){if(document.getElementsByTagName)for(var e=document.getElementsByTagName("a"),t=0;t<e.length;t++){var n=e[t];n.getAttribute("href")&&(n.target="_blank")}}window.onload=externalLinks;
//]]>
</script>
Don't forget to Click Save Theme and You're done.

Try to see the results by opening one of the articles on your blog. That's all from Droidnur123.
Go to Link

About the Author

Droidnur is the Founder & CEO of droidnur.eu.org & Publisher with an Entrepreneur. He is Also a Collage Student & Full Time Passionate Blogger.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.