HTML input: text
allowing the user to enter alphanumeric content
Essentials
At the minimal, the <input>
field for type="text"
looks like this:
Other attributes can include:
maxlength
(enforces a maximum character length of input)minlength
(enforces a minimum character length of input)required
(enforces some kind of value; cannot stay blank)id
(identifies the field uniquely)differs from
name
in thatname
does not enforce uniqueness
Takeaways
Most of those attributes are self-explanatory and "google-able" but taking note that:
the difference between a
name
andid
lies on the uniqueness requirement ofid
we can use
name
multiple times in the same HTML document!
Last updated