现在可以使用 < input type = “ tel”/> 了吗?

我正在开发一个手机网络应用程序,我有几个文本字段可以从 <input type="tel"/>中受益。IPhone 会为用户调整键盘,但我担心会破坏向后兼容性。我希望支持这一点的浏览器/手机可以帮助用户和其他浏览器回到标准的文本字段?这种做法可以接受吗?有用吗?

96759 次浏览

Browsers will fall back to type="text" when they encounter unsupported input type. So I think it's OK to use type="tel".

Short answer: yes. As @el.pescado mentions, browsers fall back to type=text when they don't understand the type. For more info about the other cool features you get from HTML5 forms, check out A Form of Madness, which is the forms chapter in Dive Into HTML5.

Yes, any unsupported type will revert to the 'type=text' format.

I found a good page which lists out all the existing input types. I tried looking at it from different browsers, a bit interesting. Don't know if it will help you or not.

http://miketaylr.com/pres/html5/forms2.html

It is ok. Browsers will use type=text when they encounter unsupported types.