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
(enforce a maximum length of input)required
(enforces a 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 requirement uniqueness ofid
we can use
name
multiple times in the same HTML document!
Last updated