HTML | <input> formtarget Attribute

The HTML <input> formtarget attribute is used to specify the name or a keyword which indicates where to display the response after submitting the form. This attribute overrides the target attribute of <form> element.

Syntax:

<input formtarget="_blank|_self|_parent|_top|framename">

Attribute Values:



  • _blank: The input response is display in a new window.
  • _self: The input response is display in the same frame.
  • _parent: The input response is display in the parent frameset.
  • _top: The input response is display in the full body of the window.
  • framename: The input response is display in the named frame.

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html> 
<html>
       
<head>
    <title>
        HTML input formtarget Attribute
    </title>
</head>
  
<body
    <center
        <h1 style="color:green;"
            GeeksforGeeks 
        </h1
          
        <h2
            HTML <input> formtarget Attribute
        </h2
          
        <form action="#"
            Username: 
            <input type="text" name="usrname"
              
            <br><br>
              
            Password: 
            <input type="text" name="password"
              
            <br><br
              
            <input type="submit" value="Submit" formtarget="_blank"
        </form
    </center
</body
  
</html

chevron_right


Output:

Supported Browsers: The browsers supported by HTML <input> formtarget attribute are listed below:

  • Google Chrome 9.0
  • Internet Explorer 10.0
  • Firefox 4.0
  • Safari 5.1
  • Opera 10.6


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.