AI摘要

本文介绍了Bootstrap对HTML5 input类型的支持,包括text、password等15种类型,并强调了正确声明type的重要性。通过将input的type设置为number,可以限制用户只能输入数字。
本文介绍了

场景

Bootstrap 提供了对所有原生的 HTML5 的 input 类型的支持,包括:
text、password、datetime、datetime-local、date、month、time、week、number、email、url、search、tel 和 color。
适当的 type 声明是必需的,这样才能让 input 获得完整的样式。

举例

添加对输入内容是否为数字的验证
只需要将type改为number,则只能输入数字

inputtype.png



最后修改:2019 年 12 月 14 日
点赞的人是最酷的