Skip to content

Buzzingz

Unleashing the Power of Code

  • HTML
  • CSS
  • JavaScript
  • Toggle search form

HTML Form Target Attribute

Posted on March 4, 2023April 1, 2023 By shani No Comments on HTML Form Target Attribute

The target attribute is used in HTML forms to specify the target window or frame where the form submission result will be displayed. It specifies the name of the target window or frame in which the response from the server will be displayed.

The target attribute is usually used in conjunction with the action attribute to define where the form data should be submitted and how the response should be displayed. The possible values for the target attribute are:

  • _self: The response will replace the current document in the same window or frame where the form was submitted.
  • _blank: The response will be displayed in a new window or tab.
  • _parent: The response will replace the parent frame of the current frame where the form was submitted.
  • _top: The response will replace the top-level browsing context (i.e., the entire window or tab) where the form was submitted.
  • A named window or frame: The response will be displayed in the window or frame with the specified name.

Here is an example of how to use the target attribute in an HTML form:

<form action="submit-form.php" method="post" target="_blank">
  <label for="name">Name:</label>
  <input type="text" id="name" name="name"><br>
  <label for="email">Email:</label>
  <input type="email" id="email" name="email"><br>
  <input type="submit" value="Submit">
</form>

In this example, the form data will be submitted to the submit-form.php script using the HTTP POST method, and the response will be displayed in a new window or tab.

HTML

Post navigation

Previous Post: HTML Form Attributes
Next Post: HTML Form Elements

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

HTML Tutorial

  • HTML History
  • HTML Editors
  • What is an HTML Element?
  • HTML Attributes
  • HTML Headings
  • HTML Paragraphs
  • HTML Styles
  • HTML Text Formatting
  • HTML Quotation and Citation Elements
  • HTML Comments
  • HTML Colors
  • HTML Styles – CSS
  • HTML Links
  • HTML images
  • HTML Favicon
  • HTML Tables
    • HTML Table Colgroup
    • HTML Table Colspan and Rowspan
    • HTML Table Headers
    • HTML Table Padding and Spacing
    • HTML Table Sizes
    • HTML Table Styling
  • HTML List
  • HTML Ordered Lists
  • HTML Unordered List
  • HTML other lists
  • HTML Block and Inline Elements
  • HTML class Attribute
  • HTML id Attribute
  • HTML Iframes
  • HTML JavaScript
  • HTML File Paths
  • HTML – The Head Element
  • HTML Layout Elements and Techniques
  • HTML Responsive Web Design
  • HTML Computer Code Elements
  • HTML Semantic Elements
  • HTML Style Guide
  • HTML Entities
  • HTML Symbols
  • HTML Emojis
  • HTML Encoding (Character Sets)
  • HTML Uniform Resource Locators(URL)
  • HTML Versus XHTML
  • HTML Forms
  • HTML Form Attributes
  • HTML Form Elements
  • HTML Form Target Attribute
  • HTML Input Attributes
  • HTML Input form Attributes
  • HTML Input Types
  • HTML Canvas Graphics
  • HTML SVG Graphics
  • HTML Multimedia
  • HTML Video
  • HTML Audio
  • HTML Plug-ins
  • HTML YouTube Videos
  • HTML Geolocation API
  • HTML Drag and Drop API
  • HTML Web Storage API
  • HTML Web Workers API
  • HTML SSE API
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions

Copyright © 2023 Buzzingz.

Powered by PressBook WordPress theme