Skip to content

showModal of dialog element not supported #598

@mawinter69

Description

@mawinter69

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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions