亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Attributes accesskey (attribute) class (attribute) contenteditable (attribute) contextmenu (attribute) data-* (attribute) dir (attribute) draggable (attribute) dropzone (attribute) Global attributes hidden (attribute) id (attribute) itemid (attribute) itemprop (attribute) itemref (attribute) itemscope (attribute) itemtype (attribute) lang (attribute) slot (attribute) spellcheck (attribute) style (attribute) tabindex (attribute) title (attribute) translate (attribute) Elements a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 head header hr html i iframe img input input type="button" input type="checkbox" input type="color" input type="date" input type="datetime"-local input type="email" input type="file" input type="hidden" input type="image" input type="month" input type="number" input type="password" input type="radio" input type="range" input type="reset" input type="search" input type="submit" input type="tel" input type="text" input type="time" input type="url" input type="week" ins kbd label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt rtc ruby s samp script section select slot small source span strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr Miscellaneous Attributes Block-level elements CORS enabled image CORS settings attributes Element Inline elements Kinds of HTML content Link types Microdata Optimizing your pages for speculative parsing Preloading content Reference Supported media formats Using the application cache Obsolete acronym applet basefont big blink center command content dir element font frame frameset hgroup image input type="datetime" isindex keygen listing marquee nextid noframes plaintext strike tt xmp
characters

HTML<form>元素表示了文檔中的一個(gè)區(qū)域,這個(gè)區(qū)域包含有交互控制元件,用來向web服務(wù)器提交信息。

可以用:valid:invalidCSS 偽類 來給一個(gè)元素指定樣式。

內(nèi)容類別

流量的內(nèi)容,明顯的內(nèi)容

允許的內(nèi)容

流內(nèi)容,但不包含<form>元素

標(biāo)記遺漏

沒有,起始和結(jié)束標(biāo)簽都是強(qiáng)制性的。

允許的父母

任何接受流內(nèi)容的元素

允許ARIA角色

組,演示文稿

DOM界面

HTMLFormElement

屬性

這個(gè)元素包括一些 全局屬性.

acceptHTML 4一個(gè)逗號分隔的列表,包括服務(wù)器能接受的內(nèi)容類型。

可用性備注: 這個(gè)屬性將會(huì)在HTML5中被移除并且不再被使用。作為替代,使用 <input>元素中的accept 屬性。

accept-charset一個(gè)空格分隔或逗號分隔的列表,這個(gè)列表包括了服務(wù)器支持的字符編碼。瀏覽器以這些編碼被列舉的順序使用它們。默認(rèn)值是一個(gè)保留字符串“UNKNOWN”。這個(gè)字符串指的是,和包含這個(gè)form元素的文檔相同的編碼。

在之前版本的HTML中,不同的字符編碼可以用空格或逗號分隔。在HTML5中,只有空格可以允許作為分隔符。

action一個(gè)處理這個(gè)form信息的程序所在的URL。這個(gè)值可以被 <button>或者 <input>元素中的 formaction屬性重載(覆蓋)。

autocapitalize這是一個(gè)被 iOS Safari Mobile 使用的非標(biāo)準(zhǔn)屬性。當(dāng)用戶在一些form的文本后代控件中,輸入/編輯一些文本值時(shí),這個(gè)屬性控制了是否和怎樣,對這些文本值首字母大寫化。如果 autocapitalize 屬性在某個(gè)單獨(dú)的form后代控件被指定的話,那么這個(gè)單獨(dú)的設(shè)定會(huì)干掉(原先)form范圍內(nèi)的 autocapitalize 設(shè)定. 這個(gè)非不推薦的值從 iOS 5 及其之后可用. 默認(rèn)值為 sentences. 可以選擇的值如下:

  • none: 完全禁用自動(dòng)首字母大寫.

  • sentences: 自動(dòng)對每句話首字母大寫.

  • words: 自動(dòng)對每個(gè)單詞首字母大寫.

  • characters: 自動(dòng)大寫所有的字母.

  • on:  從 iOS 5 以后不被推薦使用.

  • off:  從 iOS 5 以后不被推薦使用.

autocompleteHTML5用于指示 input 元素是否能夠擁有一個(gè)默認(rèn)值,這個(gè)默認(rèn)值是由瀏覽器自動(dòng)補(bǔ)全的。這個(gè)設(shè)定可以被屬于這個(gè)form的子元素的autocomplete 屬性重載(覆蓋)。 可能的值有:

  • off: 在每一個(gè)用到的輸入域里,用戶必須顯式的輸入一個(gè)值,或者document 以它自己的方式提供自動(dòng)補(bǔ)全;瀏覽器不會(huì)自動(dòng)補(bǔ)全輸入。

  • on: 瀏覽器能夠根據(jù)用戶之前在form里輸入的值自動(dòng)補(bǔ)全。

對于大多數(shù)設(shè)置autocomplete屬性的現(xiàn)代瀏覽器(包括Firefox 38+,Google Chrome 34+,IE 11+),都不會(huì)阻止瀏覽器的密碼管理器詢問用戶是否要存儲登錄字段(用戶名和密碼),如果用戶允許瀏覽器在下次用戶訪問該頁面時(shí)自動(dòng)填寫登錄信息。請參閱自動(dòng)填充屬性和登錄字段。

注意:如果你在一個(gè)表單里把 autocomplete設(shè)置成 off 是因?yàn)?nbsp;document 提供了它獨(dú)有的自動(dòng)補(bǔ)全,那么你也應(yīng)該把這個(gè)表單里每一個(gè) input 元素的 autocomplete設(shè)成off 來讓 document 能夠自動(dòng)補(bǔ)全.

enctype當(dāng)method 屬性值為 post 時(shí), enctype 是提交form給服務(wù)器的內(nèi)容的 MIME 類型 ??赡艿娜≈涤?

  • application/x-www-form-urlencoded: 如果屬性未指定時(shí)的默認(rèn)值。

  • multipart/form-data: 這個(gè)值用于一個(gè) type 屬性設(shè)置為 "file" 的 <input> 元素。

  • text/plain (HTML5)

這個(gè)值可以被 <button>或者 <input> 元素中的 formenctype 屬性重載(覆蓋)。

method瀏覽器使用這種 HTTP方式來提交 form. 可能的值有:

  • post: 指的是 HTTPPOST 方法; 表單數(shù)據(jù)會(huì)包含在表單體內(nèi)然后發(fā)送給服務(wù)器.

  • get: 指的是 HTTP GET 方法; 表單數(shù)據(jù)會(huì)附加在 action 屬性的URI中,并以 '?' 作為分隔符, 然后這樣得到的 URI 再發(fā)送給服務(wù)器. 當(dāng)這樣做(數(shù)據(jù)暴露在URI里面)沒什么副作用,或者表單僅包含ASCII字符時(shí),再使用這種方法吧。

這個(gè)值可以被 <button>或者 <input> 元素中的 formmethod 屬性重載(覆蓋)。

name這個(gè)form的名字。在HTML4中,這個(gè)用法不被推薦(作為替代,應(yīng)該使用id). HTML5中,一個(gè)文檔中的多個(gè)form當(dāng)中,name必須唯一而不僅僅是一個(gè)空字符串。

novalidateHTML5這個(gè)布爾類型的屬性指示了,當(dāng)提交時(shí)form是否沒有被驗(yàn)證。 如果這個(gè)屬性沒有指定 (因此這個(gè) form 是驗(yàn)證通過的),這個(gè)默認(rèn)設(shè)置可以被屬于這個(gè)form的 <button>或者 <input> 元素中的formnovalidate 屬性重載(覆蓋)。

target一個(gè)名字或者說關(guān)鍵字,用來指示在提交表單之后,在哪里顯示收到的回復(fù). 在 HTML 4 里, 這是一個(gè)用于 frame 的名字/關(guān)鍵字. 在 HTML5 里, 這是一個(gè)用于 browsing context 瀏覽器上下文  的名字/關(guān)鍵字 (舉例來說, 標(biāo)簽頁tab, 窗口window, or 或者行內(nèi) frame). 如下的關(guān)鍵字含有特別的含義:

  • _self: 在當(dāng)前HTML4或HTML5文檔頁面重新加載返回值。這個(gè)是默認(rèn)值。譯注:也就是說如果這個(gè)文檔在一個(gè)frame中的話,self是在當(dāng)前frame(document)中重新加載的,而不是整個(gè)頁面(window)。

  • _blank: 以新的HTML4或HTML5文檔窗口加載返回值。

  • _parent: 在父級的frame中以HTML4或HTML5文檔形式加載返回值,如果沒有父級的frame,行為和_self一致。

  • _top: 如果是HTML 4文檔: 清空當(dāng)前文檔,加載返回內(nèi)容;HTML5: 在當(dāng)前文檔的最高級內(nèi)加載返回值,如果沒有父級,和_self的行為一致。

  • iframename: 返回值在指定frame中加載。

HTML5: 這個(gè)值可以被 <button>或者 <input> 元素中的formtarget 屬性重載(覆蓋)。

示例

HTML 內(nèi)容

<!-- Simple form which will send a GET request --><form action="" method="get">  <label for="GET-name">Name:</label>  <input id="GET-name" type="text" name="name">  <input type="submit" value="Save"></form><!-- Simple form which will send a POST request --><form action="" method="post">  <label for="POST-name">Name:</label>  <input id="POST-name" type="text" name="name">  <input type="submit" value="Save"></form><!-- Form with fieldset, legend, and label --><form action="" method="post">  <fieldset>    <legend>Title</legend>    <input type="radio" name="radio" id="radio">    <label for="radio">Click me</label>  </fieldset></form>

規(guī)范

規(guī)范

狀態(tài)

評論

HTML Living Standard該規(guī)范中'<form>'的定義。

生活水平


HTML5該規(guī)范中'<form>'的定義。

建議


HTML 4.01規(guī)范該規(guī)范中'<form>'的定義。

建議

初始定義

瀏覽器兼容性

Feature

Chrome

Edge

Firefox

Internet Explorer

Opera

Safari

Basic Support

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

accept

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

accept-charset

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

action

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

autocapitalize

No

No

No

No

No

No

autocomplete

(Yes)1

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

enctype

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

method

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

name

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

novalidate

1

(Yes)

4

10

?

?

target

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

Feature

Android

Chrome for Android

Edge mobile

Firefox for Android

IE mobile

Opera Android

iOS Safari

Basic Support

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

accept

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

accept-charset

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

action

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

autocapitalize

No

No

No

No

No

No

(Yes)

autocomplete

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

enctype

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

method

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

name

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

novalidate

?

?

(Yes)

4

(Yes)

?

?

target

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

Previous article: Next article: