亚洲国产日韩欧美一区二区三区,精品亚洲国产成人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<dialog>元素表示一個(gè)對(duì)話框或其他交互式組件,例如一個(gè)檢查員或窗口。

內(nèi)容類別

流量?jī)?nèi)容,切片根

允許的內(nèi)容

流量?jī)?nèi)容

標(biāo)記遺漏

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

允許父母

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

允許ARIA角色

alertdialog

DOM界面

HTMLDialogElement

屬性

這個(gè)元素包含全局屬性。該tabindex屬性不能在<dialog>元素上使用。

open表示該對(duì)話框處于活動(dòng)狀態(tài)并可用于交互。當(dāng)open屬性沒有設(shè)置時(shí),不應(yīng)該向用戶顯示。

使用說明

  • <form>通過用屬性指定元素,可以將元素集成到對(duì)話框中method="dialog"。當(dāng)提交這樣的表單時(shí),對(duì)話框被關(guān)閉,其returnValue屬性被設(shè)置為所value使用的提交按鈕。

  • ::backdropCSS偽元素使用在<dialog>元素之后,例如, 在模式對(duì)話框處于活動(dòng)狀態(tài)時(shí)使無法訪問的內(nèi)容變暗。

示例

簡(jiǎn)單的例子

<dialog open>  <p>Greetings, one and all!</p></dialog>

高級(jí)示例

當(dāng)單擊“更新詳細(xì)信息”按鈕時(shí),此示例打開一個(gè)包含一個(gè)表單的彈出對(duì)話框。

HTML

<!-- Simple pop-up dialog box, containing a form --><dialog open id="favDialog">  <form method="dialog">    <section>      <p><label for="favAnimal">Favorite animal:</label>      <select id="favAnimal">        <option></option>        <option>Brine shrimp</option>        <option>Red panda</option>        <option>Spider monkey</option>      </select></p>    </section>    <menu>      <button id="cancel" type="reset">Cancel</button>      <button type="submit">Confirm</button>    </menu>  </form></dialog><menu>  <button id="updateDetails">Update details</button></menu>

JavaScript

(function() {  var updateButton = document.getElementById('updateDetails');  var cancelButton = document.getElementById('cancel');  var favDialog = document.getElementById('favDialog');  // Update button opens a modal dialog
  updateButton.addEventListener('click', function() {
    favDialog.showModal();  });  // Form cancel button closes the dialog box
  cancelButton.addEventListener('click', function() {
    favDialog.close();  });})();

運(yùn)行結(jié)果

規(guī)范

規(guī)范

狀態(tài)

評(píng)論

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

生活水平


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

建議

初始定義

瀏覽器兼容性

Feature

Chrome

Firefox (Gecko)

Internet Explorer

Opera

Safari

Basic support

37

No support1

No support

24

No support

Feature

Android

Firefox Mobile (Gecko)

IE Mobile

Opera Mobile

Safari Mobile

Basic support

37

No support

No support

No support

No support

Previous article: Next article: