码迷,mamicode.com
首页 > 其他好文 > 详细

form表单

时间:2020-02-15 18:34:29      阅读:71      评论:0      收藏:0      [点我收藏+]

标签:type   document   inter   提交   地址   int   put   选择   lan   

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input[type="submit"]{
            /* color:green; */
            background-color: greenyellow;
        }
    </style>
</head>
<body>
    <!-- 表单的action属性值为表单提交的服务器地址  -->
    <form action="html001.html">
        <!-- 注意:数据要提交到服务器中,必须要为元素指定一个name属性值 -->
        姓名:<input type="text" name="username"><br>
        密码:<input type="password" name="password"><br>
        <!-- 单选按钮:
                    像这种选择框,必须指定一个value属性,name必须指定同一个
                     value属性最终会做为用户的填写值传递给服务器 
                    默认按钮选中 checked-->
        性别:<label for="male">男</label><input type=‘radio‘ id="male" name="sex" value="1">
            <label for="female">女</label><input type="radio" id="female" name="sex" value="2"><br>
            <!-- 多选按钮:
                    value属性最终会作为用户的填写值传递给服务器
                    默认按钮选中 checked-->
        兴趣:<label for="run">跑步</label><input type="checkbox" id="run" name="interest" value="1">
             <label for="ping-pang">乒乓</label><input type="checkbox" id="ping-pang" name="interest" value=2><br>
        <!-- 下拉列表 value值为用户的填写值传递给服务器   
                     默认选中属性 selected -->
             城市:<select name="city">
                <option value="beijing">北京</option>
                <option value="tianjin">天津</option>
                <option value="xi‘an">西安</option>
        </select>    
        <input type="submit">
    </form>
</body>
</html>

form表单

标签:type   document   inter   提交   地址   int   put   选择   lan   

原文地址:https://www.cnblogs.com/kukai/p/12312831.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!