HTML <input> formtarget Attribute

❮ HTML <input> tag

Example

<form action="action.php">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname">

  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname">

  <input type="submit" value="Submit">
  <input type="submit" formtarget="_blank" value="Submit in new window">
</form>

Meaning

formtarget attribute is set to the name of a window or frame that the button will target the result of action; in other words, where the result should appear.

This action is similar to the target attribute on <a> and <form> elements.


Standard Syntax

HTML: <input formtarget="_self|_blank|_parent|_top|frameName">

XHTML:  <input formtarget="_self|_blank|_parent|_top|frameName"/>



Browser Support




Status







Attribute Values

Value Description
_self Load the response into the same tab or window.
_blank Load the response into a new tab or window.
_parant Load the response into the parent tab or window.
_top Load the response into the top-level tab or window.
frameName Load the response into the named frame
❮ HTML <input> tag