Horje
What is Text Fields

The <input type="text"> defines a single-line input field for text input.


Example of Text Fields

A form with input fields for text:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>Text input fields</h2>

<form>
  <label for="fname">First name:</label><br>
  <input type="text" id="fname" name="fname" value="John"><br>
  <label for="lname">Last name:</label><br>
  <input type="text" id="lname" name="lname" value="Doe">
</form>

<p>Note that the form itself is not visible.</p>

<p>Also note that the default width of text input fields is 20 characters.</p>

</body>
</html>

Output should be:

Example of Text Fields





Related Articles
What is HTML Forms HTML Forms
What is The <form> Element HTML Forms
What is The <input> Element HTML Forms
What is Text Fields HTML Forms
What is The HTML <label> Element HTML Forms
How to add HTML Radio Buttons HTML Forms
How to create HTML Checkboxes HTML Forms
How to create HTML Submit Button HTML Forms
How to create HTML Name Attribute for <input> HTML Forms
What is HTML Form Attributes HTML Forms

Single Articles
Example of Text FieldsHTML Forms

Read Full:
HTML Forms
Category:
Web Tutorial
Sub Category:
HTML Forms
Uploaded:
1 year ago
Uploaded by:
Admin
Views:
55


Reffered: https://www.w3schools.com/html/html_forms.asp

Share on: