An HTML form is used to take input from users and send their data in backend. In this article we will try to explain the functionality of a HTML Form.

Forms in HTML

You might have filled a lot of forms in your life, offline and online. To sign up at any website, we need to fill a form with our basic details. These form data are later saved in a database table. Every time, you try to login, your data is fetched from the same table. HTML too provides tags to develop an online form.

Within form too, we need different types of controls like: we need to take input text for name, radio button for gender, checkboxes for subjects, calendar for date of birth, submit button etc.

Note: A form itself is never visible, it integrates multiple elements all together and performs a single action on them.




<!DOCTYPE html>
<h2>Example of a Form</h2>
<form action="/action_page.php">
    <input type="text" placeholder="Enter your Name">
    <input type="number">
    <input type="radio" name="gender" value="male" checked>Male<br>
    <input type="radio" name="gender" value="female" checked>Female<br>
    <input type="submit" value="Submit">



HTML Form Output

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.