什么html5表单属性应该用于邮政编码? [英] What html5 form attribute should be used for a zipcode?

查看:171
本文介绍了什么html5表单属性应该用于邮政编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最好使用带有字符数限制的'text'属性,还是可以在输入中使用zip编码的数字属性。

Is it best to use a 'text' attribute with a limit on the number of characters, or can I use a number attribute in an input for a zipcode.

试着用html5中的表单来了解所有不同的属性。
干杯

Just trying to get my head around all the different attributes with the forms in html5. Cheers

推荐答案

你可以试试这个

<Label>ZIP Code</Label><input type="text" pattern="[0-9]{5}" title="Five digit zip code" />

这篇关于什么html5表单属性应该用于邮政编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆