zoukankan      html  css  js  c++  java
  • form表单

    <!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>
  • 相关阅读:
    点赞
    js点击事件,数字累加
    html中hr的各种样式使用
    基于Bootstrap垂直响应的jQuery时间轴特效
    bootstrop日历
    前端经验
    bootstrop登陆页面
    bootstrop设置背景图片自适应屏幕
    建立博客的第一天
    php伪静态--隐藏地址实际路径方法
  • 原文地址:https://www.cnblogs.com/kukai/p/12312831.html
Copyright © 2011-2022 走看看