Home > other >  Make a button that opens a fresh new tab in HTML, no link, just a new tab
Make a button that opens a fresh new tab in HTML, no link, just a new tab

Time:09-17

Is it possible to make a button, that when clicked, opens a new tab. Not any link, just a new tab. so far I have <button target="_blank" onclick="location.href = ''">New Tab</button>

CodePudding user response:

Simply link to about:blank with the target _blank

<a target="_target" href="about:blank"><button>New Tab</button></a>

CodePudding user response:

The answer is, its impossible. You can't navigate to the users default home page, as stated by Gradyn Wursten. Though you can navigate to a blank white page, using about:blank

  • Related