The HTML
<input>
element is used to create interactive controls for web-based forms in order to accept data from the user. How an<input>
works varies considerably depending on the value of its type attribute.
input
标签不是html5
的新标签,但是是变化比较大的标签。主要是增加了一些强大的功能,由于实习期间写得表单比较多,所以特别有感悟,用的好的话可以省去很多麻烦的事。
formaction formenctype formmethod
用这个属性可以在input 的button里面设置一个与form不一样的action,这样你可以一个表单进行多种操作,增删改查都可以,在不知道这个属性之前,我一直是用js来改变action的。。。autocomplete autofocus 属性
自动完成和打开页面后自动获取焦点required
必填字段max min
最大字段和最小字段placeholder
输入框默认的提示,颜色可以改变,默认是灰色,用户输入后就消失。list
规定的输入格式,比如网址