My code like this to create the new tab from one tab to another in same browser.
function newTab()
{
var form1 = document.createElement("form");
form1.id = "newTab1"
form1.method = "GET";
form1.action = "domainname"; //My site address
form1.target = "framename"; //Browser tab name
document.body.appendChild(form1);
form1.submit();
}
Above code works correctly to create the new tab . when click from "MyNewTab" link the home page
<a href="javascript:newTab()" style=" margin-left:15px;" id="newTab"> MyNewTab </a>
Again i try to switch over home page to newly opened tab. This time need to switch from home page to new Tab without reload. But this newtab content reloaded.
How to get the tab name and get focus the newly opened tab from click the "MyNewTab" link ?