HTML Inputs

Last Updated:

HTML Inputs

The HTML provides web developers three ways to get inputs from the user. They are

  • <input> - The <input> tag accepts single-line user input.
  • <textarea> - The <textarea> tag accepts multi-line user input.
  • contenteditable - The <contenteditable> attribute used to edit the content of the element.

HTML <input> Tag

The <input> tag creates form fields that accept single-line user input.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <p>Type Anything in the Input Field</p> <input type="text"> </body> </html>

HTML <textarea> Tag

The <textarea> tag accepts multi-line user input.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <p>Type Anything in Textarea Field</p> <textarea rows="4" cols="50"> Prewritten text.(not mandatory) </textarea> </body> </html>

HTMT contenteditable Attribute

The contenteditable is a global attribute used to edit the content of the element.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <div contenteditable="true">This text is editable</div> </body> </html>

Share this Page

Meet the Author