亚洲国产日韩欧美一区二区三区,精品亚洲国产成人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 <label>元素表示用戶界面中項目的標題。

內(nèi)容類別

Flow content, phrasing content, interactive content, form-associated element, palpable content.

允許的內(nèi)容

Phrasing content ,但沒有子代標簽元素。除了有標簽的控制以外,不允許有任何可標記的元素。

標記遺漏

沒有,起始和結(jié)束標簽都是強制性的。

允許父級

任何接受短語內(nèi)容的元素。

允許ARIA角色

沒有

DOM界面

HTMLLabelElement

屬性

這個元素包含全局屬性。

for

可標記的 form相關(guān)元素的ID,在同一文檔中作為label元素。 第一個這樣的元素在文檔中有一個ID匹配屬性值,作為這個label元素的labeled control。

 label元素可同時有屬性和包含控件元素(contained control element),只要此for屬性指向包含控件元素。

form

HTML5與標簽關(guān)聯(lián)的表單元素(表單所有者)。如果指定,則該屬性的值是<form>同一文檔中元素的ID 。這使您可以將標簽元素放置在文檔中的任何位置,而不僅僅是其表單元素的后代。

此內(nèi)容屬性已于2016年4月28日從HTML規(guī)范中刪除。但是,腳本仍然可以訪問只讀HTMLLabelElement.form屬性; 它將返回標簽的關(guān)聯(lián)控件所屬的表單,或者null標簽與控件沒有關(guān)聯(lián),或者控件不是表單的一部分。

使用說明

  • <label>通過將控件元素放置在<label>元素中,或者通過使用for屬性,可以將A 與控件相關(guān)聯(lián)。這種控制被稱為標簽元素的標簽控制。一個輸入可以與多個標簽相關(guān)聯(lián)。

  • 標簽本身并不直接與表單關(guān)聯(lián)。他們只是通過與他們相關(guān)的控制與形式間接聯(lián)系在一起。

例子

簡單的標簽示例

<label>Click me <input type="text"></label>

使用“for”屬性

<label for="username">Click me</label><input type="text" id="username">

規(guī)范

Specification

Status

Comment

HTML Living StandardThe definition of '<label>' in that specification.

Living Standard


HTML5The definition of '<label>' in that specification.

Recommendation


HTML 4.01 SpecificationThe definition of '<label>' in that specification.

Recommendation

Initial definition

瀏覽器兼容性

Feature

Chrome

Edge

Firefox

Internet Explorer

Opera

Safari

Basic Support

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

for

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

form

(Yes)

(Yes)

(Yes) — 49

(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)

for

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

form

(Yes)

(Yes)

(Yes)

(Yes) — 49

(Yes)

(Yes)

(Yes)

Previous article: Next article: