首页 > 其他分享 >表单

表单

时间:2023-03-14 23:12:38浏览次数:23  
标签:网页 承德 表单 啊啊啊 邮箱 下拉框

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的第一个网页</title>
</head>
<body>

<!-- 表单
method 规定如何发送表单数据 get我们可以通过网页看到账号密码消息(高效不安全) post安全,可以传输大文件
action 表示向何处发送表单数据
deadonly 只读
diabled 禁用
hidden 隐藏
input:
    type:指定元素类型
    name:指定表单元素名称(都要带上)
    value:元素初始值,type为radio时必须指定一个值,这个是选中的元素传入的数据值
    size:宽度,当type为text和password时,表单元素的大小以字符为单位,其他类型以像素为单位
    maxlength当type为text和password时,输入最大字符数
    checked type为radio或checked是,指定按钮是否被选中
-->
<form method="get" action="6.html" c>
    <!-- 文本框
    label for指向一个id,点击这个label就会自动选择id对应的元素
    placeholder 提示信息
    required 必须填写,不用为空
    pattern 正则表达式
    -->
    <p> <label for="mark">名字:</label><input type="text" name="userName" id="mark" size="10" maxlength="5"  placeholder="请输入用户名" > </p>
    <!-- 密码框-->
    <p>密码:<input type="password" name="password"  required></p>
    <!-- 单选框  加上name后,同一个name是一组-->
    <input type="radio" name="sex" value="boy">男 <input type="radio" name="sex" value="girl">女</p>
    <!-- 多选框-->
    <p>
        <input type="checkbox" name="city" >西安
        <input type="checkbox" name="city">北京
        <input type="checkbox" name="city">承德
    </p>
    <!-- 图片提交按钮,这个相当于submit按钮-->
    <p>
        <input type="image" src="../永恩.jpg">
    </p>
    <!--下拉框
    selected 默认选项
    -->
    <p>下拉框:
        <select name="国家" >
            <option value="中国">中国</option>
            <option value="美国">美国</option>
            <option value="英国" selected>英国</option>
            <option value="俄国">俄国</option>

        </select>
    </p>
    <!-- 文本域-->
    <p>
        <textarea rows="5" cols="20" name="文本域" >啊啊啊啊</textarea>
    </p>
    <!-- 文件域-->
    <p>
        <input type="file" name="files">
    </p>

    <!-- 邮箱验证(鸡肋) -->
    <p>邮箱:<input type="email">   数字: <input type="number">
    </p>
    <!-- 滑块-->
    <p>
        <input type="range" max="100" min="10" name="滑块">
    </p>
    <!-- 搜索框-->
    <p>
        <input type="search" name="搜索框">
    </p>

    <!-- 提交按钮和重置按钮-->
    <p>
        <input type="submit"><input type="reset">
    </p>


</form>

</body>
</html>

标签:网页,承德,表单,啊啊啊,邮箱,下拉框
From: https://www.cnblogs.com/geeklee/p/17216811.html

相关文章