<form> tag in HTML

The <form> tag is used to create a form for user input in HTML, a HTML <form> can contain one or more form elements like radio-buttons, lable, textarea, fieldset, input, output, etc.

  • Open and close tag required in <form>.

Example of <form> tag

Result Look Like

First name:

Last name:

<form> Tag Browser Support

All modern and old browser supports <form> tag, the browsers name listed below:

Element Chrome Edge Firefox Safari Opera
<form> Yes Yes Yes Yes Yes

Global Attributes

Event Attributes

Attributes

All <form> standard attributes are listed below table:

Attribute Value Description
accept file_type Accept attribute is not supported in HTML5. It defines a comma-separated list of file types that the server accepts
accept-charset character_list Defines the character encodings that are to be used for the form submission that the server accepts
action URL Defines a URL of the back-end script that will process the form
autocomplete on
off
Defines whether a form should have autocomplete on or off
enctype MIME_types Defines how the form-data should be encoded when submitting it to the server
method get
post
Defines the HTTP method to use when sending form-data
name form_name Defines a unique name for the form.
novalidate novalidate Defines that the form should not be validated when submitted.
target _blank
_self
_parent
_top
All values of target attributes play a role, Specifies where to display the response that is received after submitting the form

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

© 2023 GDATAMART.COM (All Rights Reserved)