HTML Forms

HTML forms have become an integral part of the web. Forms enable website users to enter and submit data via the website.

Forms are created by using the <form> tag. The <form> element declares the form, but you also need to place form-associated elements inside this element (or reference the form via the form-associated element's form attribute). The elements you use will depend on what you want the form to do.

Basic Form Example

Here's an example of a basic HTML form:

Source CodeResult
Pick a color: Red Green Blue

As you can see, the form includes a bunch of <input> elements to provide some functionality.

Form–Associated Elements

The following elements are form–associated elements. These elements can be associated with a form by being enclosed between its start/end tags, or by using the form attribute. For more information, see the <form> tag.

Form Codes

Here are pages that provide copy/paste codes for various form elements and functions.

About was created in order to provide HTML tools, codes, tutorials, and other resources to help webmasters create and maintain their HTML documents. aims primarily at beginners, but may also be useful to web professionals.

About the HTML Codes

The HTML codes on this website are provided free of charge, for you to use however you wish. Feel free to modify the code to suit your own needs.

Need Hosting?

Our partner site HOSTEK provides website hosting, domain names and related products at some of the best prices on the web. If you need web hosting, check them out!