MalumaDev
MalumaDev

Reputation: 161

Dialog showModal() does not work

Why does this code not work in Safari?

var dialog_=document.createElement("dialog");
dialog_.id="dialog";
$("body").append(dialog_);
...
document.getElementById("dialog").showModal();

showModal() function should work in Safari.

Upvotes: 2

Views: 2341

Answers (1)

David
David

Reputation: 7285

EDIT

In a first answer to this question I stated that the method has been deprecated, what it is wrong: showModalDialog() (a different thing) has been deprecated.

Thanks to cregox (see comments) for reporting it.


The HTMLDialogElement interface is an experimental technology that, so far, has not been implemented by Safari.

If you don't know caniuse.com (much more reliable than w3schools.com), it will be a huge help for you in the future: check this.

I have reported the mistake to w3schools.

Upvotes: 1

Related Questions