DEV Community

[Comment from a deleted post]
Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
melnik909 profile image
Stas Melnikov

the difference is in displaying. Solution with inputmode is more simple because you haven't to hide arrows that is in the solution with type="number"

Collapse
 
Sloan, the sloth mascot
Comment deleted
 
Sloan, the sloth mascot
Comment deleted
 
melnik909 profile image
Stas Melnikov

There are different cases. For the email field we should use type only. For specific fields (like I showed in the post) we should use the inputmode

 
Sloan, the sloth mascot
Comment deleted
 
melnik909 profile image
Stas Melnikov

I test code which Is my posts. I use JAWS for it. I wrote the 3 example with type="text", type="tel" and inputmode. All results are the same. codepen.io/melnik909/full/oNbaRja

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

type="number" is for actual numbers, which a phone number isn't. You can't add, subtract, or divide phone numbers, and they can (and often do) have meaningful leading zeroes. So at the end of the day, they are still type="text".

Collapse
 
stephanie profile image
Stephanie Handsteiner

There's input type="tel" for phone numbers, so you don't have to use text. ;)