I tried this code
window.open(\'page2.html\',\'_newtab\');
And all it opened was a new window. How do I open a new tab?
You can do this easily. See the answer here.