17、表单

20 篇文章 0 订阅
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表单</title>
</head>
<body>
<!--
		form 表单容器

		input:表单元素
			type:表单的类型
				text:文本输入框
				submit:提交按钮
				button:按钮
				reset:重置
				password:密码
				radio:单选按钮
				checkbox:多选按钮
				file:文件域 上传文件

		textarea:多行文本输入框
		select:下拉框 select里面必须包含option
	 -->
<form>
    <!-- 文本输入框 -->
    <input aria-label="" type="text" name="">
    <br>
    <!-- 密码输入框 -->
    <input aria-label="" type="password" name="">
    <br>
    <!--
        label与input建立联系 当我点击姓名的时候,就能获取inout输入框的焦点
        for与你想要关联的inout输入框的id一致
      -->
    <label for="xqa">姓名:</label>
    <input type="text" name="" id="xqa">
    <label for="zq">姓名:</label>
    <input type="text" name="" id="zq">
    <br>
    <!-- 提交按钮 能够提交到接口地址 -->
    <input type="submit" name="">
    <!-- 重置按钮 -->
    <input type="reset" name="" value="清空">
    <button>我也是按钮</button>
    <br>
    <!-- placeholder 文本输入框默认的提示内容 -->
    姓名: <input aria-label="" type="text" name="" placeholder="请输入姓名">
    <!-- value 是设置input输入框默认展示的内容 -->
    <!-- disabled 表单禁用 -->
    年龄: <input aria-label="" type="text" name="" value="18" disabled>
    <br>
    <!-- 上传文件 -->
    <input type="file" name="">
    <br>
    <!-- checked 设置默认选中的内容 -->
    <!-- 单选按钮需要配合name使用 给多个radio设置相同的name属性才能实现单选 -->
    <input aria-label="" type="radio" name="sex">男
    <input aria-label="" type="radio" name="sex" checked>女
    <input aria-label="" type="radio" name="sex">不详
    <br>
    <!-- checkbox多选按钮 -->
    <input aria-label="" type="checkbox" name="" checked>唱歌
    <input aria-label="" type="checkbox" name="">睡觉
    <input aria-label="" type="checkbox" name="">打游戏
    <br>
    <!-- 多行文本输入框 rows行 cols列 -->
    <textarea aria-label="" rows="20" cols="30"></textarea>
    <br>
    <!--
         select里面必须包含option  一个option是一个选项
         selected 默认选中
         hidden 隐藏
         disabled 禁用
      -->
    <select aria-label="">
        <option selected hidden>请选择省份</option>
        <option>山东</option>
        <option>北京</option>
        <option>上海</option>
        <option>河北</option>
        <option disabled>河南</option>
    </select>
</form>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

雪花酥01

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值