
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to use formtarget attribute in HTML?
The formtarget attribute in HTML is used to indicate where the response that is received after the form submission is displayed. It overrides the target attribute of the HTML form tag. Use the formtarget attribute only with input type submit an image.
Here are the attribute values of the formtarget attribute −
S. No | Value | Description |
1 | _blank | Response gets displayed in a new window or tab |
2 | _self | The default value. The response gets displayed in the same frame. |
3 | _parent | Response gets displayed in the parent frame |
4 | _top | Response gets displayed in the full body of the window |
5 | framename | Response gets displayed in a named iframe |
Example
You can try to run the following code to learn how to use the formtarget attribute in HTML.
<!DOCTYPE html> <html> <head> <title>HTML formtarget attribute</title> </head> <body> <form action = ”/new.php” method = "get"> Student Name<br><input type = "text" name = "name"/><br> Student Subject<br><input type = "text" name = "subject"/><br> <input type = "submit" value = "Submit"> <input type = "submit" formtarget = "_blank" value="Submit (new window)"> </form> </body> </html>
- Related Articles
- How to use autocomplete attribute in HTML?
- How to use formnovalidate attribute in HTML?
- How to use formaction attribute in HTML?
- How to use formenctype attribute in HTML?
- How to use multiple attribute in HTML?
- How to use pattern attribute in HTML?
- How to use placeholder attribute in HTML?
- How to use step attribute in HTML?
- How to use href attribute in HTML Page?
- How to use a novalidate attribute in HTML?
- How to use the formmethod attribute in HTML?
- How to use the required attribute in HTML?
- HTML DOM Input Submit formTarget property
- How to use image height and width attribute in HTML Page?
- How to use different step attribute in one range input in HTML?

Advertisements