Languages

HTML - form target _blank

0 points
Asked by:
Isaiah89
361

Can I add target="_blank" to the HTML form element to open the web page in a new tab on submit event?

1 answer
0 points
Answered by:
Isaiah89
361

Yes, you can.

The below example will open this question page in a new tab after you click the button.

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<body>
  <form action="/questions/HTML-form-target-blank-1Goq41" target="_blank">
    <button type="submit">Click me!</button>
  </form>
</body>
</html>
0 comments Add comment
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join