As you have it, this is not possible because your links are just normal HTML links. When the new page opens in a new tab, the current page will not have any reference to it and so cannot change it in any way. You will need to open the page using javascript and set the title that way.

You can dynamically set this up in window onload to find all a tags and add a click event whihc opens the window and sets the title.

If you want different titles for each page, you can store this in a data- attribute in the a tag.

Note tho that this will only work with pages in the same domain (for security), and that it does not handle people right clicking and pressing "Open in New Window". Middle click in Windows does seem to work however.

HTML

<a href="test.html" data-title="A new page" target="_blank">open me</a>

JavaScript

window.addEventListener("load", function() {

    // does the actual opening
    function openWindow(event) {
        event = event || window.event;

        // find the url and title to set
        var href = this.getAttribute("href");
        var newTitle = this.getAttribute("data-title");
        // or if you work the title out some other way...
        // var newTitle = "Some constant string";

        // open the window
        var newWin = window.open(href, "_blank");

        // add a load listener to the window so that the title gets changed on page load
        newWin.addEventListener("load", function() {
            newWin.document.title = newTitle;
        });

        // stop the default `a` link or you will get 2 new windows!
        event.returnValue =  false;
    }

    // find all a tags opening in a new window
    var links = document.querySelectorAll("a[target=_blank][data-title]");
    // or this if you don't want to store custom titles with each link
    //var links = document.querySelectorAll("a[target=_blank]");

    // add a click event for each so we can do our own thing
    for(var i = 0; i < links.length; i++) {
        links[i].addEventListener("click", openWindow.bind(links[i]));
    }

});

Sample JsFiddle

Answer from Rhumborl on Stack Overflow
Top answer
1 of 7
9

As you have it, this is not possible because your links are just normal HTML links. When the new page opens in a new tab, the current page will not have any reference to it and so cannot change it in any way. You will need to open the page using javascript and set the title that way.

You can dynamically set this up in window onload to find all a tags and add a click event whihc opens the window and sets the title.

If you want different titles for each page, you can store this in a data- attribute in the a tag.

Note tho that this will only work with pages in the same domain (for security), and that it does not handle people right clicking and pressing "Open in New Window". Middle click in Windows does seem to work however.

HTML

<a href="test.html" data-title="A new page" target="_blank">open me</a>

JavaScript

window.addEventListener("load", function() {

    // does the actual opening
    function openWindow(event) {
        event = event || window.event;

        // find the url and title to set
        var href = this.getAttribute("href");
        var newTitle = this.getAttribute("data-title");
        // or if you work the title out some other way...
        // var newTitle = "Some constant string";

        // open the window
        var newWin = window.open(href, "_blank");

        // add a load listener to the window so that the title gets changed on page load
        newWin.addEventListener("load", function() {
            newWin.document.title = newTitle;
        });

        // stop the default `a` link or you will get 2 new windows!
        event.returnValue =  false;
    }

    // find all a tags opening in a new window
    var links = document.querySelectorAll("a[target=_blank][data-title]");
    // or this if you don't want to store custom titles with each link
    //var links = document.querySelectorAll("a[target=_blank]");

    // add a click event for each so we can do our own thing
    for(var i = 0; i < links.length; i++) {
        links[i].addEventListener("click", openWindow.bind(links[i]));
    }

});

Sample JsFiddle

2 of 7
3

You can pass the title with hash and get it on another page, if this another page is yours and you can modify its code.

1st page:

...
<a href="test.html#the_title_you_want" target="_blank">open me<a>
...

2nd page - modify the body opening tag like this:

<body onload="document.title=window.location.hash.replace('#','');">

If the page you are linking to isn't yours, you can use window.open method:

<a href="javascript:var mw = window.open('test.html');mw.document.title = 'the_title_you_want';">open me</a>
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Window › open
Window: open() method - Web APIs | MDN
By default, window.open opens the page in a new tab. If popup is set to true, it requests that a minimal popup window be used. The UI features included in the popup window will be automatically decided by the browser, generally including an address bar only.
Discussions

Create new tab and rename its title
🌐 forum.jquery.com
javascript - Open a URL in a new tab (and not a new window) - Stack Overflow
I've tested the below given answers from duke and arikfr and they work perfectly fine in FF, Chrome and Opera except IE (where it doesn't work) and Safari (where it opens in new window instead of new tab). 2013-04-05T07:15:44.65Z+00:00 ... @AliHaideri The Javascript has nothing to do with how ... More on stackoverflow.com
🌐 stackoverflow.com
html - Set tab title on javascript window.open to show PDF file - Stack Overflow
The problem i am having is that ... new tab opened. I would like to set a title like "PDF File" or just the name of the document (i am getting the file data and the file name separately and passing it to my downloadFile function. Is there any way to set the title to this tab? Thanks in advance! ... Another way to do this might be to send an iframe to a new window instead of ... More on stackoverflow.com
🌐 stackoverflow.com
April 28, 2021
How to change window title on a window.open?
Yea, being superseded by the browser was the issue I was seeing, so I guess the extension I found that lets me just rename the window will do. Basically DisplayFusion lets you set up different profiles that save and restore all your window positions and sizes. The problem is it's based on a combination of the window title, class, or process. Since opening multiple windows like the one I was working with all yield the same generic "Twitch" window title, it wouldn't be able to save/restore 3 different windows that have the same title. Being able to rename them with that extension does the trick. Hopefully others might find this post useful. More on reddit.com
🌐 r/bookmarklets
6
2
January 16, 2024
🌐
W3Schools
w3schools.com › jsref › met_win_open.asp
Window open() Method
window.open("http://www.google.com/"); window.open("https://www.w3schools.com/"); Try it Yourself » · Open a new window.
🌐
GoLinuxCloud
golinuxcloud.com › home › javascript › how to open a new tab in javascript? [solved]
How to open a new tab in JavaScript? [SOLVED] | GoLinuxCloud
March 13, 2023 - The window.open() method is a built-in JavaScript method that allows the opening of a new browser window or tab. This method takes two parameters, the URL of the page to be opened and the target attribute that specifies where to open the link.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-open-url-in-new-tab-using-javascript
How to Open URL in New Tab using JavaScript? - GeeksforGeeks
The return value of window.open() is a reference to the newly created window or tab.
Published   August 21, 2025
Find elsewhere
🌐
Position Is Everything
positioniseverything.net › home › javascript open new tab: browser settings and parameter values matter
JavaScript Open New Tab: Browser Settings and Parameter Values Matter - Position Is Everything
October 8, 2025 - The JavaScript open windows make it easier to perform other tasks while referring to the parent window. To open a new window or to open new tab JavaScript uses the same procedure – window.open() method.
🌐
GitHub
gist.github.com › 9644318
jQuery: Add attribute title="Link opens in a new tab" to links with target="_blank" · GitHub
April 27, 2020 - jQuery: Add attribute title="Link opens in a new tab" to links with target="_blank" - new-tab-attribute.js
🌐
Reddit
reddit.com › r/bookmarklets › how to change window title on a window.open?
r/bookmarklets on Reddit: How to change window title on a window.open?
January 16, 2024 -

Hi all, new to the concept of bookmarklets. I have a little bit of JS knowledge but not great. I'm trying to get this example bookmark to open with a custom window title but I can't quite figure out how. Any pointers? This is exactly what I'm using as my bookmark which is opening the window as I want it; I just need to change the window title so I can set it up in a DisplayFusion window position profile.

I might have achieved what I need using this extension, but wouldn't hurt to learn how this can be done from JS. https://chromewebstore.google.com/detail/change-page-title/ebbfpplpmnoblfmdkbicmakmbbjijdpg

javascript:void(window.open('https://player.twitch.tv/?channel=shroud&enableExtensions=true&muted=true&parent=twitch.tv&player=popout&volume=0%27,%27popout_chat%27,%27width=800,height=400%27))

🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-open-url-in-a-new-window-using-javascript
How to open URL in a new window using JavaScript? - GeeksforGeeks
August 21, 2025 - By specifying target="_blank", the link will open in a new tab. This approach is straightforward and commonly used for external links, enhancing user experience by keeping the current page intact.
🌐
Quora
quora.com › How-do-I-open-a-new-tab-and-focus-to-an-old-tab-on-click-in-Javascript
How to open a new tab and focus to an old tab on click in Javascript - Quora
Browsers will allow you to call focus() on the Window object returned ... To open a new browser tab and — on a later click — switch focus back to an existing (previously opened) tab in JavaScript you must work within browser security constraints: you can only open and later focus windows/tabs that your script originally opened and only in user-gesture contexts (e.g., a click).
🌐
Educative
educative.io › answers › how-to-open-a-link-in-a-new-tab-with-html-and-javascript
How to open a link in a new tab with HTML and JavaScript
No, HTML’s target="_blank" or JavaScript’s window.open() method are the primary methods for opening links in a new tab.
🌐
EyeHunts
tutorial.eyehunts.com › home › javascript open new tab with content | example code
JavaScript open new tab with content | Code - EyeHunts
January 5, 2022 - var tab = window.open('about:blank', '_blank'); tab.document.write(html); // where 'html' is a variable containing your HTML tab.document.close(); // to finish loading the page ...
🌐
SitePoint
sitepoint.com › javascript
Changing the TITLE on a popup window - JavaScript - SitePoint Forums | Web Development & Design Community
December 2, 2005 - I know that to change/add a message to the TITLE bar on the browser you have to use document.title, but, if you window.open I think you can’t. The reason to this is because on the popup window it shows the url and the page name, somethng like http://www.MySite.com - Input Data - Microsoft Internet Explorer and I don’t want the url to show up. ... You can change the title in a popup window from the main window. var newwin = window.open(…
🌐
Themeco
theme.co › support
JavaScript to open new Tab Window - Support - Themeco Forum
January 7, 2022 - Hi Team, I am using the following JS and CSS as column links on my home page. But I want two of the links of open new windows because they are external links. How can I alter the code to do that… jQuery( document ).ready(function($) { $(’#column-boats’).on(‘click touched’, function() { window.location.href = ‘https://www.easttexasboatrentals.com/home.html’; }); $(’#column-vans’).on(‘click touched’, function() { window.location.href = ‘/reservations/’; }); $(’#junglefloat’).on(‘click touch...
🌐
DEV Community
dev.to › digvijaysingh › how-to-open-a-new-tab-or-window-using-javascript-5ebc
How to Open a New Tab or Window using Javascript? - DEV Community
October 23, 2020 - var win = window.open('https://google.com/', '_blank'); if (win) { //Browser allows the new tab to open win.focus(); } else { //Browser has blocked it alert('Please allow popups for this website'); } Source : How to open New tab using javascript or jquery and open href in it?
🌐
UsefulAngle
usefulangle.com › post › 232 › javascript-open-url-new-window-tab
How to Open URL in a New Tab with Javascript - UsefulAngle
A URL can be opened in a new tab in Javascript using the window.open() method, and giving _blank as its second parameter.
🌐
Quora
quora.com › How-can-I-change-the-title-of-my-web-page-using-JavaScript-if-someone-navigates-to-another-tab-in-their-browser
How to change the title of my web page using JavaScript if someone navigates to another tab in their browser - Quora
Answer (1 of 4): This is possible by detecting if the focus is on the current tab. It can be done with the jQuery code: [code]$(function() { var pageTitle = $("title").text(); $(window).blur(function() { $("title").delay(3000).queue(function() ...