HTML <form> target Attribute
Definition and Usage
target
This attribute specifies where the action URL will be opened.
target
The attribute can define the name or keyword of the tab, window, or inline frame, indicating where the response received after submitting the form will be displayed.
Example
Display the received response in a new window or tab:
<form action="/action_page.php" method="get" target="_blank"> <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> <input type="submit" value="Submit"> </form>
Syntax
<form target="_blank|_self|_parent|_top|framename">
Attribute Value
Value | Description |
---|---|
_blank | Display the response in a new window or 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 named iframe. |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |