表单

  1. 表单<form></form>

    • action:提交的地址
    • target:跳转目标
    • method:表单的提交方式(post/get(默认))
  2. 输入框:<input>

    • name:用于提交的名字

    • value:默认值

    • maxlength:最大长度

    • type:输入的类型

      • text
      • password:输入不可见
      • radio:单选按钮,需要配合name和value,checked默认选中
      • checkbox:复选按钮,需要配合name和value,checked默认选中
      • hide:隐藏
      • reset:重置,不要写name
      • submit:提交,不要写name
      • button:默认按钮
  3. 按钮:<button></button>

    • type

      • button:默认按钮
  4. 文本域:<textarea></textarea>

    • cols=“横行”
    • rows=“竖列”
  5. 下拉框<select></select>

    • 选项框:<option></option>​最好配合value,如何没有设置提交的就在中间的值,selected默认值
  6. 禁用表单控件

    • disabled​:禁止使用
  7. 关联

    1. <label>需要关联的所有内容</label>
    2. <label for="需要关联id"></label>
  8. 分组

    <fieldset></fieldset>可以为表单分组
    <legend></legend>分组标题