Web Addresses
Web addressesâknown to many as URLs, and to
a few pedants as
URIsâare another type of specialized text. The syntax of
a web address is constrained by the relevant Internet standards. If
someone asks you to enter a web address into a form, heâll be expecting
something like http://www.google.com
,
not â125 Farwood Road.â Forward slashes and periods are common, but spaces
are forbidden. And every web address has a domain suffix like â.comâ or
â.orgâ.
Behold...(drum roll please)...<input
type="url">
. On the iPhone, it looks like Figure 9-4.
Figure 9-3. Keyboard optimized for entering an email address
Figure 9-4. Keyboard optimized for entering a URL
Just as it does for email address fields, the iPhone provides a special virtual keyboard thatâs optimized for web addresses. The space bar has been completely replaced with three virtual keys: a period, a forward slash, and a â.comâ button. You can long-press the â.comâ button to choose other common suffixes, like â.orgâ or â.netâ.
Browsers that donât support HTML5 will treat
type="url"
exactly like type="text"
, so thereâs no downside to using it
for all your web addressâinputting needs.
Get HTML5: Up and Running 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.