-
-
Notifications
You must be signed in to change notification settings - Fork 184
Closed
Description
When I have a dialog element
<button id="showMyDialog">Show dialog</button>
<dialog id="mydialog">
Hello World<br/>
<button id="dismiss">Dismiss</button>
</dialog>
And I want to show this dialog in javascript with
showButton = document.getElementById("showMyDialog");
showButton.addEventListener("click", showMyDialog);
dismissButton = document.getElementById("dismiss");
dismissButton.addEventListener("click", closeMyDialog);
function showMyDialog() {
mydialog = document.getElementById("mydialog");
mydialog.showModal();
}
function closeMyDialog() {
mydialog = document.getElementById("mydialog");
mydialog.close();
}
I'm not able to test this with htmlunit as showModal is not supported
Metadata
Metadata
Assignees
Labels
No labels