web页面是什么意思哪些输入类型

您要找的页面不存在 - 简书
您要找的页面不存在
可能是因为您的链接地址有误、该文章已经被作者删除或转为私密状态。HTML5日期输入类型(date) – WEB骇客
HTML5日期输入类型(date)
在很多页面和web应用中都有输入日期和时间的地方,最典型的是订飞机票,火车票,酒店,批萨等网站。
在HTML5之前,对于这样的页面需求,最常见的方案是用Javascript日期选择组件。这几乎是无可争议、别无选择的做法。你可以在搜寻一下“javascript 日期选择框”,会发现有无数的可选择的JavaScript组件。大部分这些日期选择组件都提供将日期填充到指定的输入框里的功能。
HTML5里的dateinput类型给了给了浏览器实现原生日历的机会,从此之后,JavaScript版的日历组件将退出历史舞台。
HTML5规范里只规定date,并没有规定日历弹出框的实现和样式。所以,各浏览器根据自己的设计实现日历。
目前只有谷歌浏览器完全实现日历功能。相信这种局面很快就会结束,所有的浏览器最终都将会提供原生的日历组件。
如果你使用的是谷歌浏览器,那你就可以在下面的实例演示中看到这个漂亮的日期组件。用鼠标点击输入框,就能看到浏览器原生的日历框。
约会日期:
如果你当前使用的浏览器还没有实现日历组件,下面的图片你可以先睹为快。
无需任何的JavaScript,它变成了一个最基本的 &input type=”date”/&
&label for="meeting"&约会日期:&/label&&input id="meeting" type="date" value=""/&
HTML5让Web程序员的工作变得异常简单,不是吗?不仅如此,我们得到的不仅仅只有一个“日期”类型的input,还有一系列相关的日期、时间参数让我们自定义。我们虽然称之为“日期”类型,但这里的type实际上是可以为“date”、“week”、“month”、“time”、“datetime”和“datetime-local”。下面我将用实例加图文的方式向大家演示各种type的外观表现。
需要提醒的是,下面的截图都是在谷歌浏览器中效果,其它浏览器中显示的样子会稍有不同,但功能会是一样的。
1. 日期(&input type=”date”/&)
这是最基本的日期选择器,你只能从日历中选择某个日期。
请选择日期:
2. 周(&input type=”week”/&)
这时,你选择的就不是一个日期了,而是周。请注意周数显示的方式。
请选择周:
3. 月份(&input type=”month”/&)
这时你选择的是月份,跟“date”类型比起来少了后面的日子数。
请选择月:
4. 时间(&input type=”time”/&)
这是最简单的一种显示,没有日历,只能选择时间。
请选择时间:
5. 日期+时间(&input type=”datetime”/&)
既显示日期组件,又显示时间组件,其实就是“date”类型和“time”类型的组合。
请选择日期和时间:
6. 本地日期时间(&input type=”datetime-local”/&)
顾名思义,就是用本地时间显示。
请选择日期和时间:
除了上面这些类型为,日期输入类型还有一些其它属性需要注意。
这是HTML里input元素的通用属性。就是输入框里的数据。
日期或时间的最小值
日期或时间的最大值
步长。不同的类型有不同的缺省步长。
Date – 缺省是1天
Week – 缺省是1周
Month – 缺省是1月
Time – 缺省是1分钟
DateTime – 缺省是1分钟
Local DateTime – 缺省是1分钟
阅读余下内容
相关文章:&input&:输入(表单输入)元素
HTML &input& 元素用于为基于Web的表单创建交互式控件,以便接受来自用户的数据。
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone and send us a pull request.
流动区域; 内容区域; 交互式内容(如果不是处于hiddenhidden状态); 列表,可标签,可提交,可重置,与表单相关的元素。
允许的内容
无,这是一个。
必须有开始标签但不必有结束标签。
Permitted parents
Any element that accepts .
Permitted ARIA roles
type=button: , , , , , ,
type=checkbox: , , ,
type=image: , , , , ,
type=radio:
type=color|date|datetime|datetime-local|email|file: None
type=hidden|month|number|password|range|research: None
type=search|submit|tel|text|url|week: None
_types">Form &input& types
How an &input& works varies considerably depending on the value of its type attribute, hence the different types are covered in their own separate reference pages. If this attributes is not specified, the default type adopted is text.
可用的值包括:
button:无缺省行为按钮。
checkbox: 复选框。必须使用 value 属性定义此控件被提交时的值。使用 checked 属性指示控件是否被选择。也可以使用 indeterminate 指示复选框在一种不确定状态(大多数平台上,显示为一条穿过复选框的水平线)。
color: 用于指定颜色的控件。
date: 用于输入日期的控件(年,月,日,不包括时间)。
datetime: 基于 UTC 时区的日期时间输入控件(时,分,秒及几分之一秒)。
datetime-local: 用于输入日期时间控件,不包含时区。
email: 用于编辑 e-mail 的字段。 合适的时候可以使用
CSS 伪类。
file:此控件可以让用户选择文件。使用 accept 属性可以定义控件可以选择的文件类型。
hidden:不显示在页面上的控件,但它的值会被提交到服务器。
image:图片提交按钮。必须使用 src 属性定义图片的来源及使用 alt 定义替代文本。还可以使用 height 和 width 属性以像素为单位定义图片的大小。
month: 用于输入年月的控件,不带时区。
用于输入浮点数的控件。
password:一个值被遮盖的单行文本字段。使用 maxlength 指定可以输入的值的最大长度 。
radio:单选按钮。必须使用 value 属性定义此控件被提交时的值。使用checked 必须指示控件是否缺省被选择。在同一个”单选按钮组“中,所有单选按钮的 name 属性使用同一个值; 一个单选按钮组中是,同一时间只有一个单选按钮可以被选择。
range: 用于输入不精确值控件。如果未指定相应的属性,控件使用如下缺省值:
value:min + (max-min)/2,或当 max 小于 min 时使用 min
reset:用于将表单所内容设置为缺省值的按钮。
search:用于输入搜索字符串的单行文本字段。换行会被从输入的值中自动移除。
submit:用于提交表单的按钮。
tel: 用于输入电话号码的控件;换行会被自动从输入的值中移除A,但不会执行其他语法。可以使用属性,比如 pattern 和 maxlength 来约束控件输入的值。恰当的时候,可以应用
CSS 伪类。
text:单行字段;换行会将自动从输入的值中移除。
time: 用于输入不含时区的时间控件。
url: 用于编辑URL的字段。 The user may enter a blank or invalid address. 换行会被自动从输入值中移队。可以使用如:pattern 和 maxlength 样的属性来约束输入的值。 恰当的时候使可以应用
CSS 伪类。
week: 用于输入一个由星期-年组成的日期,日期不包括时区。
_属性">全局 &input& 属性
本节列出了所有表单&input&类型可用的属性。 非全局属性和全局属性指定在不同&input&类型上的行为不同;这些差异都列在这些类型的独立页面上。
注意:这包括。
要呈现的控件类型。有关各个类型的信息,请参阅 ,其中包含指向每个类型的更多信息的链接。
如果该元素的 type 属性的值是file,则该属性表明了服务器端可接受的文件类型;否则它将被忽略。该属性的值必须为一个逗号分割的列表,包含了多个唯一的内容类型声明:
以 STOP 字符 (U+002E) 开始的文件扩展名。(例如:".jpg,.png,.doc")
一个有效的 MIME 类型,但没有扩展名
audio/* 表示音频文件
video/* 表示视频文件
image/* 表示图片文件
only, 已废弃
用户按下后可以获得此控件焦点的单个字符。这是 HTML5 全局属性。
mozactionhint
Specifies an "action hint" used to determine how to label the enter key on mobile devices with virtual keyboards. Supported values are go, done, next, search, and send; these automatically get mapped to the appropriate string (and are case-insensitive).
autocapitalize
This is a nonstandard attribute used by iOS Safari Mobile which controls whether and how the text value should be automatically capitalized as it is entered/edited by the user. The non-deprecated values are available in iOS 5 and later. Possible values are:
none: Completely disables automatic capitalization
sentences: Automatically capitalize the first letter of sentences.
words: Automatically capitalize the first letter of words.
characters: Automatically capitalize all characters.
Deprecated since iOS 5.
Deprecated since iOS 5.
autocomplete
这个属性表示这个控件的值是否可被浏览器自动填充。如果type属性的值是hidden、checkbox、radio、file,或为按钮类型(button、submit、reset、image),则本属性被忽略。可用的值是:
off: 用户必须手动填值,或者该页面提供了自己的自动补全方法。浏览器不对此字段自动填充。
on: 浏览器可以根据用户先前的填表情况对此字段自动填值。
name: 完整的姓名
honorific-prefix: Prefix or title (e.g. "Mr.", "Ms.", "Dr.", "Mlle")
given-name :名
additional-name
family-name:姓
honorific-suffix: Suffix (e.g. "Jr.", "B.Sc.", "MBASW", "II")
new-password: 新密码(如创建帐号或更改密码时使用)
current-password
organization-title: Job title (e.g. "Software Engineer", "Senior Vice President", "Deputy Managing Director")
organization
street-address
address-line1, address-line2, address-line3, address-level4, address-level3, address-level2, address-level1
country-name
postal-code
cc-name: Full name as given on the payment instrument
cc-given-name
cc-additional-name
cc-family-name
cc-number: Code identifying the payment instrument (e.g. the credit card number)
cc-exp: Expiration date of the payment instrument
cc-exp-month
cc-exp-year
cc-csc: Security code for the payment instrument
cc-type: Type of payment instrument (e.g. Visa)
transaction-currency
transaction-amount
language: P Valid BCP 47 language tag
bday-month
sex: Gender identity (e.g. Female, Fa'afafine); Free-form text, no newlines
url: Home page or other Web page corresponding to the company, person, address, or contact information in the other fields associated with this field
photo: Photograph, icon, or other image corresponding to the company, person, address, or contact information in the other fields associated with this field
获取更多详细内容。
如果&input&元素上没有autocomplete属性,浏览器可使用包含该input元素的表单(&form&)或通过input的form属性指定的表单的autocomplete属性值。更多信息请参见的autocomplete属性。
与其他浏览器不同,autocomplete 还控制着Firefox浏览器 对 &input& 持久化动态禁用状态和(如果适用)跨页面加载的动态检查。持久化特性默认是开启的。设置autocomplete的值为off 可以关闭该特性。即使autocomplete属性通常不应用于&input&的type,它也可以工作。具体可以查看。
这个布尔属性允许您指定的表单控件在页面加载时具有焦点(自动获得焦点),除非用户将其覆盖,例如通过键入不同的控件。文档中只有一个表单元素可以具有autofocus属性,它是一个布尔值。 如果type属性设置为隐藏则不能应用(即您不能自动获得焦点的属性设置为隐藏的控件)。
This attribute should be defined as a unique value. If the value of the type attribute is search, previous search term values will persist in the dropdown across page load.
如果该元素的type属性的值为radio或者checkbox,则该布尔属性的存在与否表明了该控件是否是默认选择状态.
这个布尔属性表示此表单控件不可用。 特别是在禁用的控件中, click 事件
。 并且,禁用的控件的值在提交表单时也不会被提交。如果 type 属性为
hidden,此属性将被忽略。
The form element that the input element is associated with (its form owner). The value of the attribute must be an id of a
element in the same document. If this attribute is not specified, this &input& element must be a descendant of a
element. This attribute enables you to place &input& elements anywhere within a document, not just as descendants of their form elements.
formaction
The URI of a program that processes the information submitted by the input element, if it is a submit button or image. If specified, it overrides the
attribute of the element's form owner.
formenctype
If the input element is a submit button or image, this attribute specifies the type of content that is used to submit the form to the server. Possible values are:
application/x-www-form-urlencoded: The default value if the attribute is not specified.
multipart/form-data: Use this value if you are using an
element with the
attribute set to file.
text/plain
If this attribute is specified, it overrides the
attribute of the element's form owner.
formmethod
If the input element is a submit button or image, this attribute specifies the HTTP method that the browser uses to submit the form. Possible values are:
post: The data from the form is included in the body of the form and is sent to the server.
get: The data from the form are appended to the form attribute URI, with a '?' as a separator, and the resulting URI is sent to the server. Use this method when the form has no side-effects and contains only ASCII characters.
If specified, this attribute overrides the
attribute of the element's form owner.
If the input element is a submit button or image, this Boolean attribute specifies that the form is not to be validated when it is submitted. If this attribute is specified, it overrides the
attribute of the element's form owner.
formtarget
If the input element is a submit button or image, this attribute is a name or keyword indicating where to display the response that is received after submitting the form. This is a name of, or keyword for, a browsing context (for example, tab, window, or inline frame). If this attribute is specified, it overrides the
attribute of the elements's form owner. The following keywords have special meanings:
_self: Load the response into the same browsing context as the current one. This value is the default if the attribute is not specified.
_blank: Load the response into a new unnamed browsing context.
_parent: Load the response into the parent browsing context of the current one. If there is no parent, this option behaves the same way as _self.
_top: Load the response into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as _self.
如果type属性的值是image,这个属性定义了按钮图片的高度。
Identifies a list of pre-defined options to suggest to the user. The value must be the id of a
element in the same document. The browser displays only options that are valid values for this input element. This attribute is ignored when the type attribute's value is hidden, checkbox, radio, file, or a button type.
此项目的最大(数字或日期时间)值,且不得小于其最小值(min属性)值。
如果 type 的值是
text, email, search, password, tel, 或 url,那么这个属性指明了用户最多可以输入的字符个数(按照Unicode编码方式计数);对于其他类型的输入框,该属性被忽略。它可以大于 size 属性的值。如果不指定这个属性,那么用户可以输入任意多的字符。如果指定为一个负值,那么元素表现出默认行为,即用户可以输入任意多的字符。本属性的约束规则,仅在元素的 value 属性发生变化时才会执行。译者注:ie10+
此项目的最小(数字或日期时间)值,且不得大于其最大值(最大属性)值。
This Boolean attribute indicates whether the user can enter more than one value.这个属性指示用户能否输入多个值。这个属性仅在type属性为email或file的时候生效 ; 否则被忽视.
控件的名称,与表单数据一起提交。
检查控件值的正则表达式.。pattern必须匹配整个值,而不仅仅是某些子集.。使用title属性来描述帮助用户的模式.。当类型属性的值为text, search, tel, url 或 email时,此属性适用,否则将被忽略。译者注:ie10+
placeholder
提示用户输入框的作用。用于提示的占位符文本不能包含回车或换行。仅适用于当type 属性为text, search, tel, url or email时; 否则会被忽略。
Note: 请不要用placeholder 属性替换
元素。他们的作用不同:
属性描述表单元素的角色; 也就是说,它展示预期的信息,而placeholder 属性是提示用户内容的输入格式。某些情况下 placeholder 属性对用户不可见, 所以当没有它时也需要保证form能被理解。
这个布尔属性用于指明用户无法修改控件的值。
如果控件的 type 属性为hidden, range, color, checkbox, radio, file 或 type时,此属性会被忽略。
这个属性指定用户在提交表单之前必须为该元素填充值. 当type属性是hidden,image或者按钮类型(submit,reset,button)时不可使用.
CSS 伪元素的样式将可以被该字段应用作外观.
selectionDirection
The direction in which selection occurred. This is "forward" if the selection was made from left-to-right in an LTR locale or right-to-left in an RTL locale, or "backward" if the selection was made in the opposite direction. This can be "none" if the selection direction is unknown.
控件的初始大小。以像素为单位。但当type
属性为text 或 password时, 它表示输入的字符的长度。从HTML5开始, 此属性仅适用于当 type 属性为 text, search, tel, url, email,或 password;否则会被忽略。 此外,它的值必须大于0。 如果未指定大小,则使用默认值20。 HTML5 概述 "用户代理应该确保至少大部分字符是可见的", 但是不同的字符的用不同的字体表示可能会导致宽度不同。在某些浏览器中,一串带有x的字符即使定义了到x的大小也将显示不完整。 。
spellcheck
将此属性的值设置为true表示元素需要检查其拼写和语法。值default 表示该元素将根据默认行为进行操作,可能基于父元素自己的spellcheck值。值false表示不应该检查元素
如果type属性的值是image, 这个属性指定了按钮图片的路径; 否则它被忽视.
使用min和max 属性来限制可以设置数字或日期时间值的增量。它可以是任意字符串或是正浮点数。如果此属性未设置为任何,则控件仅接受大于最小步长值的倍数的值。
tabindex element-specific in , global in
元素在当前文档的Tab导航顺序中的位置。
only, 已废弃
作为图像映射的元素的名称.
控件的初始值. 此属性是可选的,除非type 属性是radio或checkbox。注意,当重新加载页面时,如果在重新加载之前更改了值,。
如果type属性的值是image,这个属性定义了按钮图片的宽度。
_属性">非标准 &input& 属性
autocorrect
This is a non-standard attribute supported by Safari that is used to control whether autocorrection should be enabled when the user is entering/editing the text value of the &input&. Possible attribute values are:
on: Enable autocorrection.
off: Disable autocorrection.
in the Safari HTML Reference.
incremental
This is a nonstandard attribute supported by WebKit (Safari) and Blink (Chrome) that only applies when the type is search. If the attribute is present, regardless of what its value is, the &input& fires
events as the user edits the text value. The event is only fired after an implementation-defined timeout has elapsed since the most recent keystroke, and new keystrokes reset the timeout. In other words, the event firing is debounced. If the attribute is absent, the
event is only fired when the user explicitly initiates a search (e.g. by pressing the Enter key while within field).
mozactionhint
Specifies an "action hint" used to determine how to label the enter key on mobile devices with virtual keyboards. Supported values are go, done, next, search, and send. These automatically get mapped to the appropriate string and are case-insensitive.
This is a nonstandard attribute supported by Safari that only applies when the type is search. It is used to control the maximum number of entries that should be displayed in the &input&'s native dropdown list of past search queries. Its value should be a nonnegative decimal integer.
webkitdirectory
This Boolean attribute indicates if the selector used when the type attribute is filehas to allow for the selection of directories only.
x-moz-errormessage
This Mozilla extension allows you to specify the error message to display when a field doesn't successfully validate.
input 元素造型
你可以使用各种与颜色相关的属性来设置&input&元素的样式。与文本输入相关的元素特有的一个不常见的特性是CSS 属性,该属性允许你设置用于绘制文本输入插入符的颜色
&label for="textInput"&Note the red caret:&/label&
&input id="textInput" class="custom" size="32"/&
input.custom {
caret-color:
font: 16px "Helvetica", "Arial", "sans-serif"
有关向HTML中的元素添加颜色的更多信息,请参阅。
你可以在覆盖每个单独类型的页面上找到&input&元素用法的多个例子 - 参见,也可以参考在文章的顶部。
Specification
Living Standard
Recommendation
Adds the capture element
Recommendation
Recommendation
浏览器兼容
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out
and send us a pull request.
FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari1
No1210201257
Yes4122310113.11
Yes151241010.651
Yes1201257
NoFeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
?4.32.1 — 4.357
?1. Firefox doesn't yet support inputs of type color on Windows Touch.2. The input type is recognized, but there is no date-specific control.3. See
and .4. Doesn't do validation, but instead offers a custom 'email' keyboard, which is designed to make entering email addresses easier.5. Automatically applies a default style of opacity: 0.4 to disable textual &input& elements, including those of type 'email'. Other major browsers don't currently share this particular default style.6. You can set as well as get the value of HTMLInputElement.files in this was most recently added to Firefox, in version 57 (see ).7. See .8. The input type is recognized, but there is no month-specific control.9. Android WebView recognizes the range type, but doesn't implement a range-specific control.10. Unlike other browsers, Firefox by default
of a &ltbutton&gt across page loads. Use the
attribute to control this feature.11. Unlike other browsers, Firefox by default
of a &button& across page loads. Use the
attribute to control this feature.&/button&DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
29Notes Notes Firefox doesn't yet support inputs of type color on Windows Touch.
No support
Full support
Full support
Full support
Full support
Full support
Full support
No support
Full support
Full support
Full support
No support
Full support
No support
No support
NoNotes Notes The input type is recognized, but there is no date-specific control.
Full support
Full support
Full support
Full support
Full support
Full support
Full support
No support
No support
NoNotes Notes See
No support
Full support
No support
No support
NoNotes Notes The input type is recognized, but there is no date-specific control.
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
3.1Notes Notes Doesn't do validation, but instead offers a custom 'email' keyboard, which is designed to make entering email addresses easier.Notes Automatically applies a default style of opacity: 0.4 to disable textual &input& elements, including those of type 'email'. Other major browsers don't currently share this particular default style.
Full support
Full support
Full support
1Notes Notes You can set as well as get the value of HTMLInputElement.files in this was most recently added to Firefox, in version 57 (see ).
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
No support
No support
NoNotes Notes See .
No support
Full support
No support
No support
NoNotes Notes The input type is recognized, but there is no month-specific control.
Full support
Full support
No support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
No support
2.1 — 4.3Notes Notes Android WebView recognizes the range type, but doesn't implement a range-specific control.
Full support
Full support
Full support
Full support
Full support
Full support
Full support
1Notes Notes Unlike other browsers, Firefox by default
of a &ltbutton&gt across page loads. Use the
attribute to control this feature.
Full support
Full support
Full support
Full support
Full support
Full support
Full support
4Notes Notes Unlike other browsers, Firefox by default
of a &ltbutton&gt across page loads. Use the
attribute to control this feature.
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
1Notes Notes Unlike other browsers, Firefox by default
of a &button& across page loads. Use the
attribute to control this feature.&/button&
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
4Notes Notes Unlike other browsers, Firefox by default
of a &button& across page loads. Use the
attribute to control this feature.&/button&
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
No support
Full support
No support
Full support
Full support
Full support
Full support
Full support
No support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
No support
No support
NoNotes Notes See .
No support
Full support
No support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
Full support
No support
No support
Compatibility unknown
Compatibility unknownSee implementation notes.See implementation notes.
File inputs
从Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)开始,在一个file类型的元素上调用click()方法,会打开文件选择对话框让用户选择文件. 了解更多详情.
你不能通过脚本为file类型的input元素赋值,这样做没有任何效果:
var e = getElementById("someFileInputElement");
e.value = "foo";
如果你想让Firefox在某个表单字段在有效性验证失败时显示自定义的错误消息,你可以使用 x-moz-errormessage 属性来达到这种效果:
&input type="email" x-moz-errormessage="Please specify a valid email address."&
不过需要注意的是,这不是一个标准属性,在其他浏览器中没有任何效果.
Localization
The allowed inputs for certain &input& types depend on the locale. In some locales, 1,000.00 is a valid number, while in other locales the valid way to enter this number is 1.000,00.
Firefox uses the following heuristics to determine the locale to validate the user's input (at least for type="number"):
Try the language specified by a lang/xml:lang attribute on the element or any of its parents.
Try the language specified by any Content-Language HTTP header or
If none specified, use the browser's locale.
在Firefox 移动上使用使用mozactionhint属性
当你的表单在Firefox mobile中显示时,你可以使用
属性来指定虚拟键盘中回车键上的提示文字 .例如,想要一个"Next"标签,你可以这样写:
&input type="text" mozactionhint="next" name="sometext" /&
Other form-related elements: , , , , , , , , , , , ,
In certain cases (typically involving non-textual inputs and specialized interfaces), the &input& element is a . When it is, the position and size of the elemnt's size and positioning within its frame can be adjusted using the CSS
properties
文档标签和贡献者
此页面的贡献者:
最后编辑者:
Jul 17, :49 PM
电子邮件地址
我接受 Mozilla 按照所述的方式处理我的信息。
谢谢!请检查您的收件箱以确认您的订阅。
如果您以前未确认过订阅 Mozilla 相关的新闻简报,您可能必须这样做。请检查您的收件箱或垃圾邮件箱并找到我们发给您的电子邮件。
隐藏新闻报注册}

我要回帖

更多关于 web认证在线页面 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信