# HTML Forms and Inputs - User Interaction

* HTML from is used to take input from user. For example you are creating website where user can share information. They enable data collection for various purposes such as sign-ups, contact forms, and online surveys.
    
* &lt;form&gt; tag helps to create HTML from for user input.
    
* The &lt;form&gt; element is a container for different types of input elements, such as text fields, checkboxes, radio buttons, submit buttons, etc.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1737637642051/8eff7e3b-e642-4815-8c11-a9fbab4aae05.png align="center")

**HTML Inputs**

* Using &lt;input&gt; tag you can take **any type** of information from user. you can define type input in “type“ attribute.
    
* &lt;input&gt; tag is most used for element
    
* There are some examples of text input, radio, checkbox, submit, email, password and so many other input type is available in HTML inputs.
    
* An input element can be displayed in many ways, depending on the type attribute.
    

| &lt;input type="text"&gt; |
| --- |
| &lt;input type="radio"&gt; |
| &lt;input type="password"&gt; |
| &lt;input type="email"&gt; |

```javascript
<form>
  <label>First name:</label><br>
  <input type="text"><br>
  <label>Last name:</label><br>
  <input type="text">
</form>
```

* **Label element** is used to give label to specific input. so user can understand what value to enter in input box.
    
* **Value** **attribute** specifies an initial value for an input field.
    
* **readonly** **attribute** specifies that an input field is read-only.
    
* **placeholder** **attribute** specifies a short hint that describes the expected value of an input field.
    
* There are so many other input attribute available.
    

By understanding how to use tags like &lt;from&gt;, &lt;input&gt;, and &lt;label&gt;, along with the structure of HTML documents, you can build interactive forms that make your websites more engaging and user-friendly. Start experimenting with HTML today and see what you can create!
