表单语法
<form method="post"
action="result.html"
<p>名字: <input name="name" type="text"></p>
<p>密码: <input name="pass" type="password"></p>
<p>
<input type="submit" name="Button" value="提交" />
<input type="reset" name="Reset" value="重填" />
<input type="radio" name="gender" value="男" checked
<input type="radio" name="gender" value="女" />女
<input type="checkbox" name="hobby" value="篮球"/>篮球
<input type="checkbox" name="hobby" value="排球"/>排球
<input type="checkbox" name="hobby" value="乒乓球" checked
<input type="button" name="btn1" value="点击" />
<input type="image" src="" />
<select name="列表选择">选项
<option value="china">中国</option>
<option value="us">印度</option>
<option value="germany">德国</option>
</select>
<textarea name="txt" cols="10" rows="10" >please enter your advice</textarea>
<input type="file" name="book"/>
<input type="email" name="email" />
<input type="url" name="url" />
<input type="number" name="num1" max="100" min="0" step="10"/>
<input type="range" name="voice" max="100" min="0" step="2" />
<input type="search" name="search" />
readonly 只读属性
disabled 禁止选择
hidden 隐藏
增加文本可用性
<label for="[id]"></label>
</p>
</form>
表单初级验证
- placeholder 提示 信息
- required 要求非空
- patterm 正则表达式