其他分享
首页 > 其他分享> > HTML_表单表标签_表单项_input2和HTML_表单表标签_表单项_select&textarea

HTML_表单表标签_表单项_input2和HTML_表单表标签_表单项_select&textarea

作者:互联网

file :文件选择框

hidden :隐藏域,用于提交一些信息。

按钮︰

  submit:提交按钮。可以提交表单

  button:普通按钮

  image:图片提交按钮src属性指定图片的路径

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form action="#" method="get">
        <label for="username"> 用户名</label>:<input type="text" name="username" placeholder="输入用户名" id="username"><br>
        密码:<input type="password" name="password" placeholder="输入密码"><br>
        性别:<input type="radio" name="gender" value="male" checked>男
        性别:<input type="radio" name="gender" value="female">女<br>
        爱好:<input type="checkbox" name="hobby" value="shopping" checked>逛街
            <input type="checkbox" name="hobby" value="java">java
            <input type="checkbox" name="hobby" value="gname">游戏
            图片:<input type="file" name="file"><br>
            隐藏域:<input type="hidden" name="id" value="aaa"><br>
            取色器:<input type="color" name="color"><br>
            生日:<input type="date" name="birthday"><br>
            生日:<input type="datetime-local" name="birthday"><br>
            邮箱:<input type="email" name="email"><br>
            年龄:<input type="number" name="age"><br>
        <br>

            <input type="submit" value="登录">
            <input type="button" value="按钮"><br>
            <input type="image" src="img/regbtn.jpg">
    </form>
</body>
</html>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

HTML_表单表标签_表单项_select&textarea

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form action="#" method="post">
        <table border="1" align="center" width="500">
            <tr>
                <td><label for="username">用户名</label></td>
                <td><input type="text" name="username" id="username"></td>
            </tr>

            <tr>
                <td><label for="password">密码</label></td>
                <td><input type="password" name="password" id="password"></td>
            </tr>

            <tr>
                <td><label for="email">邮箱</label></td>
                <td><input type="email" name="email" id="email"></td>
            </tr>

            <tr>
                <td><label for="name">性名</label></td>
                <td><input type="text" name="name" id="name"></td>
            </tr>

            <tr>
                <td><label for="tel">手机号</label></td>
                <td><input type="text" name="tel" id="tel"></td>
            </tr>

            <tr>
                <td><label>性别</label></td>
                <td>
                    <input type="radio" name="gender" value="male">男
                    <input type="radio" name="gender" value="female">女
                </td>
            </tr>

            <tr>
                <td><label for="birthday">出身日期</label></td>
                <td><input type="date" name="birthday" id="birthday"></td>
            </tr>

            <tr>
                <td><label for="checkcode">验证码</label></td>
                <td>
                    <input type="text" name="checkcode" id="checkcode">
                    <img src="img/verify_code.jpg">
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center"><input type="submit" value="注册"></td>
            </tr>
        </table>
    </form>
</body>
</html>

结果:

 

 

搜索

复制

标签:单项,标签,表单,HTML,提交,按钮
来源: https://www.cnblogs.com/12-12-12/p/16540760.html