The input element is by far the most lavish of all the form elements. It has a miriad of types and options.
All input types have one thing in common... they all collect or manipulate data. Even the buttons...
Keep in mind that the input tag is a closed element... because it has no data... that means there is no end or closing tag... you knew that.
CREATED2020-09-12 10:44:16.0
010-00-02-CA
UPDATED2020-09-12 10:44:28.0
Types
<input type="button" value="Press My Button"/>
There are many input types... enough for all circumstances... you would think. This is a list of the types with an example for each. The types will render differently in each browser. Some types are not supported by all browsers... like month and week
Type
Example
Button
CheckBox
Color
Date
📅
DateTime-local
email
📬
File
📂
Image
value=alt
Month
Number
Password
Radio
Radio Button
Range
😀
Reset
Search
Submit
Tel
📞
Text
Time
⌚
URL
Week
The value in the Type column goes in the type="type" attribute in the <input> tag. Here is an example of a button input tag:
Although the favored way to create a button is with the new<button> tag.
CREATED2020-09-12 10:45:19.0
010-00-02-CB
UPDATED2020-11-21 10:44:39.0
Attributes
The input tag has a mirriad of other attributes besides type. A lot of them are specialized i.e. they belong to only one type... for example the image tag has attributes width and height ... that other elements do not.
Most attributes belong to a select set of input types... In fact... there are only four (4) attributes that apply to all of them! Those are marked in blue...
CREATED2020-09-12 11:45:53.0
010-00-02-DA
UPDATED2020-11-21 10:44:47.0
Input Attributes Part I...
Name
Values
Description
Type
accept
file_extension audio/* video/* image/* media_type
File type filter for file picker
file
alt
text
Alternative text or image (same as value)
image
autocomplete
on off
Let the browser enter data
checkbox color date emailfile number radio range search tel text url
autofocus
none
Focus on page load
all
checked
none
Item is selected on load
checkboxradio
dirname
inputname.dir
Text direction is sent with form data
Text Elements
disabled
none
Element is disabled on load
all exept image
form
id
form the element belongs to
all
CREATED2020-09-12 11:51:26.0
010-00-02-DB
UPDATED2020-11-21 10:44:59.0
Input Attributes Part II (form Attributes)...
These attributes are specifically for the submit and image types. They will override the attributes of the form itself. For example the formaction attribute will override the forms action attribute.
Name
Values
Description
Type
formaction
URL
Action to take when element is submitted. Overrides form action