Nice article about the inputmode attribute

I wasn’t aware of the inputmode-attribute for input or textarea elements in HTML, but this excellent article on CSS-Tricks opened up a new world.

<input type=”text” inputmode=”numeric”>
on an Android device

Ensure your mobile users have a good experience by using inputmode rather than <input type="number" ...> etc. inputmode="numeric" can be used with maxlengthminlength and pattern attributes and therefore allows for a more controlled input.

Note: you probably want to add your own validation checks, as the browser will not do any validation with <input type="text" ...>.