Home

inputmode

Inputmode is a global HTML attribute that provides a hint to devices with on-screen keyboards about the expected type of input for a form control. It aims to improve keyboard layout popups on mobile and touch devices, but it does not enforce input restrictions or change the data type of the element.

Common values include none, text, decimal, numeric, tel, search, email, and url. These hints suggest different

Usage is straightforward on input or textarea elements. For example: <input type="text" inputmode="numeric" /> or <textarea inputmode="email"></textarea>.

Support and considerations: inputmode is implemented in major modern browsers and is primarily beneficial for improving

keyboard
configurations:
numeric
and
decimal
for
numbers,
tel
for
phone-style
keyboards,
and
email
or
url
for
corresponding
input
formats.
The
attribute
acts
as
a
hint
rather
than
a
constraint,
and
the
actual
data
type
should
be
enforced
by
the
input’s
type
attribute
and
validation
logic.
The
inputmode
value
complements
the
type
attribute
and
does
not
replace
server-side
or
client-side
validation.
Some
browsers
and
environments
may
ignore
the
hint,
especially
on
devices
with
physical
keyboards
or
non-mobile
platforms.
user
experience
on
mobile
devices.
Its
effectiveness
can
vary
by
platform
and
keyboard
implementation.
Developers
should
not
rely
on
inputmode
as
a
security
or
validation
mechanism;
it
should
be
used
as
a
usability
aid
alongside
appropriate
input
types,
validation,
and
accessible
labeling.