A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html/html-input-formtarget-attribute/ below:

HTML | <input> formtarget Attribute

HTML | <input> formtarget Attribute

Last Updated : 30 Mar, 2023

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:

Example: 

html
<!DOCTYPE html> 
<html>
     
<head>
    <title>
        HTML input formtarget Attribute
    </title>
</head>

<body> 
    <center> 
        <h1 style="color:green;"> 
            GeeksforGeeks 
        </h1> 
        
        <h2> 
            HTML &lt;input&gt; formtarget Attribute
        </h2> 
        
        <form action="#"> 
            Username: 
            <input type="text" name="username"> 
            
            <br><br>
            
            Password: 
            <input type="text" name="password"> 
            
            <br><br> 
            
            <input type="submit" value="Submit" formtarget="_blank"> 
        </form> 
    </center> 
</body> 

</html> 

Output:

  

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



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4