Horje

How to add HTML <button> formtarget _blank Attribute

_top Loads the response in the full body of the window
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The button formtarget attribute</h1>

<form action="/action_page.php" method="get">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <button type="submit">Submit</button>
  <button type="submit" formtarget="_top">Submit to a new window/tab</button>
</form>

</body>
</html>

Output should be:

How to add HTML <button> formtarget _blank Attribute




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin