How to open a URL in a new tab using javascript without focus on the page you just opened.
For example the following code is placed on the index.html
page.
<button onclick="link()">Click here</button>
<script type="text/javascript">
function link() {
window.open('pages.html');
}
</script>
When the button is clicked, it will open a new tab, but focus directly on page.html
page.
How to focus on the index.html
page?