An HTML form with two input fields and one submit button:
First name: Last name: Try it Yourself »More "Try it Yourself" examples below.
Definition and UsageThe tag is used to create an HTML form for user input.
The element can contain one or more of the following form elements:
Browser Support ElementYesYesYesYesYesAttributes AttributeValueDescriptionaccept-charsetcharacter_setSpecifies the character encodings that are to be used for the form submissionactionURLSpecifies where to send the form-data when a form is submittedautocompleteonoffSpecifies whether a form should have autocomplete on or offenctypeapplication/x-www-form-urlencoded multipart/form-data text/plainSpecifies how the form-data should be encoded when submitting it to the server (only for method="post")methodget postSpecifies the HTTP method to use when sending form-datanametextSpecifies the name of a formnovalidatenovalidateSpecifies that the form should not be validated when submittedrelexternalhelplicensenextnofollownoopenernoreferreropenerprevsearchSpecifies the relationship between a linked resource and the current documenttarget_blank _self _parent _topSpecifies where to display the response that is received after submitting the form Global AttributesThe tag also supports the Global Attributes in HTML.
Event AttributesThe tag also supports the Event Attributes in HTML.
More ExamplesExampleAn HTML form with checkboxes:
I have a bike I have a car I have a boat Try it Yourself »ExampleAn HTML form with radiobuttons:
HTML CSS JavaScript Try it Yourself »Related PagesHTML tutorial: HTML Forms and Input
HTML DOM reference: Form Object
CSS Tutorial: Styling Forms
Default CSS SettingsMost browsers will display the element with the following default values:
Exampleform { display: block; margin-top: 0em;} Try it Yourself »❮ PreviousComplete HTML ReferenceNext ❯★ +1 W3schools PathfinderTrack your progress - it's free! Log in Sign Up