表单标签笔记

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登陆界面</title>
</head>
<body>
<table border="1" cellspacing="0" width="59%">
<form action="http://www.baidu.com" method="get">
    <label  for="你好">用户名:</label> <input name="username" placeholder="请输入用户名" id="你好"><br>
    密码:  <input name="password"><br>
    <input type="radio" name="gender" value="male"><input type="radio" name="gender" value="female"><input type="radio" name="gender" value="homesex">同性恋<br>

        <tr><td>
            爱好:  <input type="checkbox">篮球
            <input type="checkbox" name="hobby" value="study">java<br>
            <input type="submit" name="password" value="登录">
        </td>

        </tr>




</form>
</table>
</body>
</html>

1、在表单<form></form>中name和value是键值属性,可以看作注释

2、input用于标签收集用户信息

3、submit用于提交信息,submit() 方法把表单数据提交到 Web 服务器。

4、可以在input属性前面加上<label for=id></label>其中id为input中的id值,用作提示信息

原文地址:https://www.cnblogs.com/guosai1500581464/p/12901549.html