open a url in a new tab using javascript – onlinecode
In this post we will give you information about open a url in a new tab using javascript – onlinecode. Hear we will give you detail about open a url in a new tab using javascript – onlinecodeAnd how to use it also give you demo for it if it is necessary.
In this tutorial, We will explain to you how to open a URL in a new tab using javascript. it is possible to open a URL in a new tab using Window open() Method in javascript.
so you can follow the below example.
<html> <head> <title></title> <script> function openInNewTab(url) { var win = window.open(url, '_blank'); win.focus(); } </script> </head> <body> <button onclick="openInNewTab('www.onlinecode.com');">Open onlinecode</button> </body> </html>
Hope this code and post will helped you for implement open a url in a new tab using javascript – onlinecode. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs