表单元素格式
type
指定元素的类型,text,password,checkbox,radio,submit,reset,file,hidden,image和button,默认为text
name
指定表单元素的名称
value
元素的初始值,type为radio时必须指定一个值
size
指定表单元素的初始宽度,当type为text或password时,表单元素大小以字符为单位,对于其他类型,宽度以像素为单位
maxlength
type为text或password时,输入的最大字符数
checked
type为radio或checkbox时,指定按钮是否是被选中
表单的应用
hidden
只读
readonly
禁用
disabled
表单初级验证
常用方式
placeholder -->提示信息
required -->非空判断
pattern -->正则表达式