学习-WEB前端快速入门- 13.13.Form表单

208 阅读1分钟

1、form表单:容器 用来承载输入框的,本身没什么效果

1.1 input
1.2 label

2、属性

action:跳转到服务器的地址
enctype:编码格式,前后端数据交互的数据格式,表单默认 form-data

3、代码

<form action="https://www.baidu.com" enctype="text/plain">
 <!--input 必须要有id,其中id中的username要跟for中username一样,表示它们是一组-->
<label for="username">用户名</label>
<input id="username" type="text">
<label for="password" >密码</label>
<input id="password" type="password"> <!--如果让密码隐藏,把type改成passWard-->
<button>提交</button>
</form>

4、显示