View video tutorial

HTML Forms


The <form> element represents a section in a document.

HTML form

HTML <form> represents a section for user input.

HTML <form> contains interactive input control elements.

<form> submits user information to the server for processing.

User input can be variety of types like text, check box, radio selection, combo box, date, file etc.

Learning with HTML Editor "Try it Now"

You can edit the HTML code and view the result using online editor.


<!DOCTYPE html>

   <title>HTML Form Example</title>
   <meta charset="utf-8" />


   <h2>Form Example</h2>

   <form action="" method="get" class="form-example">
      <div class="form-group">
         <label for="name">Enter your name: </label>
         <input type="text" name="name" id="name" required>
      <div class="form-group">
         <label for="email">Enter your email: </label>
         <input type="email" name="email" id="email" required>
      <div class="form-group">
         <input type="submit" value="Subscribe!">

Try it Now »

Click on the "See output" button to see how it works.