HTMLDOMダイアログオブジェクト
ダイアログオブジェクト
Dialogオブジェクトは、HTMLの<dialog>要素を表します。
注: <dialog>要素は現在、Chrome 37以降、Safari 6以降、Opera24以降でのみサポートされています。
ダイアログオブジェクトにアクセスする
getElementById()を使用して、<dialog>要素にアクセスできます。
例
var x = document.getElementById("myDialog");
ダイアログオブジェクトを作成する
document.createElement()メソッドを使用して、<dialog>要素を作成できます。
例
var x = document.createElement("DIALOG");
ダイアログオブジェクトのプロパティ
Property | Description |
---|---|
open | Sets or returns whether a dialog should be open or not |
returnValue | Sets or returns the dialog's return value |
ダイアログオブジェクトメソッド
Method | Description |
---|---|
close() | Closes the dialog |
show() | Shows the dialog |
showModal() | Shows the dialog and makes it the top-most modal dialog |
標準のプロパティとイベント
Dialogオブジェクトは、標準のプロパティとイベントもサポートしています。
関連ページ
HTMLリファレンス:HTML <dialog>タグ