I tried this code
window.open(\'page2.html\',\'_newtab\');
And all it opened was a new window. How do I open a new tab?
I don't think you can, from HTML / Javascript, indicate that a page should be opened in a new tab.
(In fact, your page might be opened to a new window, or to a new tab, depending on the configuration of the browser)