First name: First name:
Easy Tutorial
❮ Tag Object Ev Onclick ❯

HTML <input> formtarget Attribute

HTML <input> Tag

Example

A form with two submit buttons that submit to different target windows:

<form action="demo-form.php">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit Normally">
  <input type="submit" formtarget="_blank" value="Submit to a New Page">
</form>

Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Attribute Chrome IE Firefox Safari Opera
formtarget Yes 10.0 Yes 5.1 10.6

Definition and Usage

The formtarget attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form.

The formtarget attribute overrides the target attribute of the <form> element.

Note: The formtarget attribute can be used with type="submit" and type="image".


Differences Between HTML 4.01 and HTML5

The formtarget attribute is new in HTML5.

Note: HTML5 does not support frames and framesets. Now, the values _parent, _top, and framename are mostly used for iframes.


Syntax

Attribute Values

Value Description
_blank Displays the response in a new window/tab.
_self Displays the response in the same frame (default).
_parent Displays the response in the parent frame.
_top Displays the response in the full body of the window.
framename Displays the response in a named iframe.

❮ Tag Object Ev Onclick ❯