HTML学习笔记-表单标签
action: 用于提交数据的路径 # 代表没有提交路径 正常应该写服务器地址
method: 提交表单的方式(get post)
autocomplete 是否记录补全(on和off)
get:表单数据会显示在地址栏中,不安全,地址栏的url长度有限制!
post:表单数据不会显示在地址栏中,数据封装在请求体中,安全。长度没有限制!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>表单演示</title>
</head>
<body>
<!--get方式的表单-->
<!--
action: 用于提交数据的路径 # 代表没有提交路径 正常应该写服务器地址
method: 提交表单的方式(get post)
autocomplete 是否记录补全(on和off)
get:表单数据会显示在地址栏中,不安全,地址栏的url长度有限制!
post:表单数据不会显示在地址栏中,数据封装在请求体中,安全。长度没有限制!
-->
<form action="#" method = "get" autocomplete="off">
用户名:<input type = "text" name="username"/>
<button type = "submit">提交</button>
</form>
<!--post方式的提交-->
<form action="#" method = "post" autocomplete="off">
用户名:<input type = "text" name="username"/>
<button type = "submit">提交</button>
</form>
</body>
</html>