HTML5 Form表单

Form表单使用来用户填写信息,从而能采集用户信息,使网站有交换功能,所有用户输入的地方;
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="url" method="get|post" name="songs"></form>        <!--form 只要有用户输入的地方就会有form action  服务器地址??? name表单名字 method???-->
    <form>
        <input type="text">         <!--输入框-->
        <input type="submit">       <!--按钮-->
        <button>an</button>         <!--按钮-->             <!--type里面内容不同 表达不同-->
    </form>
</body>
</html>

表单基本组成为表单标签<form>  表单域 及输入框<input>单标签 表单按钮<button>  <input type="submit">  

表单元素

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form>
        输入框:<input type="text">             <!--文本框-->
        <input type="submit">                   <!--按钮-->
        密码:<input type="password">            <!--密码输入框-->
        <input type="submit" value="登录">                    <!--提交按钮 用value可以改变按钮名称-->
    </form>
</body>
</html>

当为输入框时type 后面跟text 按钮时后面为button 密码输入框时为password  提交按钮可通过value属性替换按钮文本

posted @ 2023-09-09 10:16  songs7  阅读(48)  评论(0)    收藏  举报