1.基本格式:
<form method=“”get“” action="表单链接地址">
</form>
2.分类
2.1.文本类在这里插入代码片
2.1.1:文本框
<input type="text">
创建文本框,输入文本(数字,汉字,字母等)
2.1.2.密码框
<input type="password">
创建一个密码框,输入的字符会被黑色实心圆代替显示。
2.1.3.文本域
<textarea rows="行数" cols=“”列数“”>--</txetarea>
创建一个空白文本框自定义大小。
2.2.选择类
2.2.1.单选
<input type="radio" name="sex" checked="checked">男
<input type="radio" name="sex">女
以上为性别选择(默认为男选项)的单项选择题
2.2.2.多选
<input type "checkbox" checked="checked">下棋
<input type "checkbox">游泳
可以多项选择(默认下棋)
2.2.3.下拉列表
<select>
<option>选项</option >
<option>选项</option >
<option>选项</option >
</select>
2.2.4.选取文件
<input type="file">
用于选取文件
3.验证
3.1.必填项
<input type ="text" requiyed="required">
此文本框为必填选项
3.2.提示项
<input type="text" planceholder="提示内容">
空白文本框带默认提示
2020年5月9日
表单
最新推荐文章于 2022-11-17 22:06:16 发布