HTML form target Attribute

Definition and Usage

The target attribute specifies where the new page should be opened.
The form data is sent to the page specified in the action attribute.
The target attribute for form is not supported in XHTML 1.0 Strict DTD.


<form target="target_frame">

Syntax Example

<form target="_blank">

Attribute Values

Value Description
_blank The target URL will open in a new window.
_self The target URL will open in the same frame as it was clicked.
_parent The target URL will open in the parent frameset.
_top The target URL will open in the full body of the window.
framename The name of the target frame the URL should open in.

Browser Support

The attribute is supported in all major browsers.


<form action="realhackings.aspx" target="_blank">
First name: 
<input type="text" name="FirstName" value="harry" />
<br />
Last name: 
<input type="text" name="LastName" value="potter" />
<br />
<input type="submit" value="Submit" />
HTML form target Attribute Reviewed by 1000sourcecodes on 03:39 Rating: 5
Powered by Blogger.