HTML一分赛车投注网站5pc28加拿大平台表单元form(一)
元素名称 | 说明 | ||||||||||||||||||||||||||||||||||||
action | 表示表单提交的页面 | ||||||||||||||||||||||||||||||||||||
method | 表示表单的请求方式:有POST和GET两种,不建议使用,默认 reset 表示按钮的作用是重置表单 button 表示按钮为一般性按钮,且更加容易设置 CSS 样式。让用户直接输入 | ||||||||||||||||||||||||||||||||||||
disabled | 禁用input元素 | ||||||||||||||||||||||||||||||||||||
autocomplete | 单独设置input元素的自动完成功能 | ||||||||||||||||||||||||||||||||||||
form | 让表单外的元素和指定的表单挂钩提交 | ||||||||||||||||||||||||||||||||||||
type | input元素的类型。默认GET | ||||||||||||||||||||||||||||||||||||
enctype | 表示浏览器对发送给服务器的数据所采用的编码格式。
//使用 get 提交数据 method="get" //丧失自动提示功能 autocomplete="off" //使用_blank 新建目标 target="_blank" 2.<input> 表示用户输入数据 <input name="user"> 解释:<input>元素默认情况会出现一个单行文本框,以便程序调用 | ||||||||||||||||||||||||||||||||||||
target | 设置提交时的目标位置:_blank、没有任何作用 //提交表单 <button type="submit">提交</button> //重置表单 <button type="reset">重置</button> //普通按钮 <button type="button">按钮</button> 对于type属性为submit时,以便接收到相应的值 |
//聚焦光标
<input name="user" autofocus>
//禁用 input
<input name="user" disabled>
//禁止自动完成
<input name="user" autocomplete="off">
//表单外的 input
<form method="get" id="register">
...
</form>
<input name="email" form="register">
3.<label> 添加说明标签
<p>label for="user">用户名:input id="user" name="user"></label></p>
解释:<label>元素可以关联 input,
属性名称 | 说明 |
form | 指定按钮关联的表单 |
formaction | 覆盖form元素的action属性 |
formenctype | 覆盖form元素的enctype属性 |
formmethod | 覆盖form元素的method属性 |
formtarget | 覆盖form元素的target属性 |
formnovalidate | 覆盖form元素的novalidate属性 |
//表单外关联提交
<button type="submit" form="register">提交</button>
本文地址:http://tiob3.xny028cc.com/by/2025-06-17-21-09-42-6.html
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。