- 论坛徽章:
- 49
|
介绍
HTML 5: 表单元素之 input 元素
表单元素之 input 元素 - text, password, url, telephone, email, search, file, radio, checkbox, button, submit, reset, number, range, image, hidden, color, datetime, datetime-local, date, time, month, week
input 元素的通用属性 - autocomplete, placeholder, pattern, dirname, size, maxlength, readonly, required, list, multiple, min, max, step
示例
1、text - 文本框
element/form/input/text.html
text
2、password - 密码框
element/form/input/password.html
password
alert(document.getElementsByTagName("input")[0].value);
3、url - url 框
element/form/input/url.html
url
alert(document.getElementsByTagName("input")[0].value);
4、telephone - 电话框
element/form/input/telephone.html
telephone
alert(document.getElementsByTagName("input")[0].value);
5、email - 电子邮件框
element/form/input/email.html
email
alert(document.getElementsByTagName("input")[0].value);
6、search - 搜索框
element/form/input/search.html
search
alert(document.getElementsByTagName("input")[0].value);
7、file - 用于上传文件
element/form/input/file.html
file
8、radio - 单选框
element/form/input/radio.html
radio
radio button title
radio button title
alert(document.getElementsByTagName("input")[0].value);
9、checkbox - 复选框
element/form/input/checkbox.html
本文来自ChinaUnix文档频道,如果查看原文请点:http://doc.chinaunix.net/web/201208/2325452.shtml |
|