VOOZH about

URL: https://www.geeksforgeeks.org/html/html-formtarget-attribute/

⇱ HTML formtarget Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML formtarget Attribute

Last Updated : 13 Dec, 2021

The HTML formTarget Attribute is used to specify the name or a keyword, that indicates where to display a result after submitting the form. It specify that the submitted result will be open in current window, a new tab or a new frame. This attribute overrides the feature of target attribute of <form> element.  

Uses: It is used in <button> and <input type="submit"> and <input type="image">

Syntax:

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

Attribute Values:

  • _blank: It opens the link in a new window.
  • _self: It has a default value.  It opens the linked document in the same frame.
  • _parent: It opens the linked document in the parent frameset.
  • _top: It opens the linked document in the full body of the window.
  • framename: It opens the linked document in the named frame.

Example: This example illustrates a form that contains two submit buttons, one will submit in a current frame and another button submit in a new frame. 


 

Output 

👁 Image

Supported Browsers:  The list of browsers supported by HTML formtarget Attribute are given below -

  • Google Chrome
  • Internet Explorer
  • Opera
  • Firefox
  • Apple Safari
Comment
Article Tags: