html表单详解

2336fa59313240b5afabd185401846e9.png

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 之前所有标签全部用于展示信息 -->
    <!-- 表单标签用于提交信息到服务器 -->

    <form action="http://httpbin.org/post" method="post">                                                                                                                                                                                           
        <div>
            <label for="un">用户名</label> <input required placeholder="请输入名字" name="username" id="un" type="text">
        </div>
        <div>
            <label for="pwd">密码</label>  <input name="password" id="pwd" type="password">
        </div>
        <div>
            <span>性别</span>
            <label for="man">男</label>  <input name="sex" value="man" checked id="man" type="radio">
            <label for="woman">女</label>  <input name="sex" value="women" id="woman" type="radio">
        </div>
        <div>
            <span>爱好</span>
            <label for="footbal">足球</label>  <input name="hobby" value="footbal" checked id="footbal" type="checkbox">
            <label for="basketball">篮球</label>  <input name="hobby" value="basketball" checked id="basketball" type="checkbox">
            <label for="newball">信球</label>  <input name="hobby" value="newball" id="newball" type="checkbox">
        </div>
        <div>
            <span>年纪</span> <input name="age" type="range" min="0" max="100" step="1">
        </div>
        <div>
            <span>喜爱颜色</span> <input name="color" type="color">
        </div>
        <div>
            <label for="more">附件</label> <input name="file" id="more" type="file">
        </div>

        <div>
            <span>居住地址</span>
            <select name="address">
                <option value="beijing">北京</option>
                <option value="shanghai">上海</option>
                <option  value="guangzhou">广州</option>
            </select>
        </div>
        <div>
            <span>学习语言</span>
            <select name="lang" multiple>
                <option value="python" >Python</option>
                <option value="c++" selected>C++</option>
                <option value="java" selected>Java</option>
            </select>
        </div>
        <div>
            <span>交友宣言</span>
            <textarea name="info" cols="100" rows="5"></textarea>
        </div>
        <div>
            <!-- <input type="submit" value="注册">  -->
             <input type="reset" value="清空">
            <button type="submit">注册</button>
        </div>
    </form>

</body>
</html>

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

码农NoError

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

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

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

打赏作者

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

抵扣说明:

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

余额充值