菁英数字科技(猩码)-猩码学苑-专注软件开发人才菁英教育
标题:
丁竹清-前端(6)-20221109
[打印本页]
作者:
清墨、
时间:
2022-11-9 22:56
标题:
丁竹清-前端(6)-20221109
列表标签(收集用户信息) 表单域
<
form
action
=
""
method
=
"get"
name
=
"userinfo"
>
<form 接收地址 提交方式 命名></form>
表单控件
<input>输入表单元素 type属性
<!-- 1、文本输入框 -->
<
input
type
=
"text"
>
<!-- 2、按钮 -->
<
input
type
=
"button"
>
<!-- 3、输入密码的输入框 -->
<
input
type
=
"password"
>
<!-- 4、单选按钮 -->
<
input
type
=
"radio"
>
男
<!-- 5、复选框 -->
<
input
type
=
"checkbox"
>
艾斯
<!-- 6、提交文件按钮 -->
<
input
type
=
"file"
>
<!-- 7、提交按钮 -->
<
input
type
=
"submit"
>
<!-- 8、重置按钮 -->
<
input
type
=
"reset"
>
</
form
>
其他属性:
<
form
action
=
""
>
请输入密码:
<
input
type
=
"text"
value
=
"请输入密码"
>
<
br
>
<
input
type
=
"button"
value
=
"登录"
>
<
input
type
=
"submit"
value
=
"提交交"
>
<
input
type
=
"radio"
name
=
"sex"
checked
=
"checked"
>
男
<
input
type
=
"radio"
name
=
"sex"
>
女
只能输入五个字符
<
input
type
=
"text"
maxlength
=
"5"
>
</
form
>
<lable>标签的使用(焦点)
<
form
action
=
""
>
<
label
for
=
"male"
>
<
input
type
=
"radio"
name
=
"sex"
id
=
"male"
>
男
</
label
>
<
label
for
=
"female"
>
<
input
type
=
"radio"
name
=
"sex"
id
=
"female"
>
女
</
label
>
</
form
>
<select>表单元素(下拉)
<
form
action
=
""
>
<
select
>
<
option
>
新竹
</
option
>
<
option
>
台北
</
option
>
<
option
>
高雄
</
option
>
<
option
>
东京
</
option
>
<
option
selected
=
"selected"
>
重庆
</
option
>
</
select
>
</
form
>
<textarea>表单元素(文本域:每行限制次数,多行)
<
form
action
=
""
>
<
textarea
cols
=
"5"
rows
=
"3"
></
textarea
>
<
textarea
cols
=
"30"
rows
=
"10"
></
textarea
>
</
form
>
表单标签
欢迎光临 菁英数字科技(猩码)-猩码学苑-专注软件开发人才菁英教育 (http://www.xingmaxueyuan.com/)
Powered by Discuz! X3.4