CREATE A TELEPHONE INPUT TYPE

You can use the telephone input type to accept into an input field telephone numbers and characters such as +, -, and a space. When a web form requires a phone number for an input field, it is relatively simple for desktop users to simply type in a phone number, but on mobile web browsers, there is no point in displaying a full-sized virtual keyboard; instead, only a numeric keypad with the telephone-related characters appears.

<input type='tel' name='field' value='telephone'>

The type='tel' attribute value activates the telephone-specific input options of the user’s web browser, if supported. Additional input element attributes, such as name and value, have the same meaning and functionality common in HTML forms. ...

Get HTML5: Your visual blueprint™ for designing rich web pages and applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.