Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML input formtarget attribute

HTML formtarget attribute

HTML input Tag Reference HTML 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=">

Normal submission

"

<input type="submit" formtarget="_blank" value=">

Submit to a new page

"

form

Try it »


Browser support

The numbers in the table indicate the first browser version that supports this property.

property
formtarget Yes 10.0 Yes 5.1 10.6

Definition and Usage

The formtarget attribute specifies the name or keyword indicating where to display the response received after the form is submitted.

The formtarget attribute overrides the

elements' target attribute.

**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, _parent, _top, and framename are mostly used with iframe.


Syntax

Attribute values

Value Description
_blank Display the response in a new window/tab.
_self Display the response in the same frame (default).
_parent Display the response in the parent frame.
_top Display the response in the entire window.
framename Display the response in the specified iframe.

HTML input Tag Reference HTML tag