Skip to content
Related Articles

Related Articles

How to define a form for user input using HTML5 ?
  • Last Updated : 11 Jun, 2020

In this article, we will learn how to create a form in a webpage by using the <form> tag. This tag is used to create form for user input. Also there are many elements which are used within form tag.


<form> Form Content... </form>

Example: The following code snippet demonstrates the simple creation of form.

<!DOCTYPE html>
        HTML5: How to define an 
        HTML form for user input?
        body {
            text-align: center;
        h1 {
            color: green;
        HTML5: How to define an 
        HTML form for user input?
    <form action="#">
        First name:
        <input type="text" 
            placeholder="First Name" value="">
        Last name:
        <input type="text" 
            placeholder="Last Name" value="">
        <input type="submit" value="Submit">

Output :

Supported Browsers:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari


My Personal Notes arrow_drop_up
Recommended Articles
Page :