HTML 5 <optgroup> 標(biāo)簽
定義和用法
<optgroup> 標(biāo)簽定義選項(xiàng)組。此元素允許您組合選項(xiàng)。當(dāng)您使用一個(gè)長(zhǎng)的選項(xiàng)列表時(shí),對(duì)相關(guān)的選項(xiàng)進(jìn)行組合會(huì)使處理更加容易。
HTML 4.01 與 HTML 5 之間的差異
沒(méi)有。
例子
<select><optgroup label="Swedish Cars">
<option value ="volvo">Volvo</option> <option value ="saab">Saab</option></optgroup>
<optgroup label="German Cars">
<option value ="mercedes">Mercedes</option> <option value ="audi">Audi</option></optgroup>
</select>
屬性
屬性 | 值 | 描述 | 4 | 5 |
---|---|---|---|---|
label | text_label | 定義選項(xiàng)組的標(biāo)注。 | 4 | 5 |
disabled | disabled | 在其首次加載時(shí),禁用該選項(xiàng)組。 | 4 | 5 |
標(biāo)準(zhǔn)屬性
class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title
如需完整的描述,請(qǐng)?jiān)L問(wèn) HTML 5 中標(biāo)準(zhǔn)屬性。
事件屬性
onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload
如需完整的描述,請(qǐng)?jiān)L問(wèn) HTML 5 中事件屬性。