Files
MichaelDimmitt 3c82896d8f Fix image in all sample readmes (#529)
* fix images in readme

* fix all sample readmes by pointing all images to correct apps location
2021-02-25 09:49:17 +11:00
..
2020-12-04 09:18:01 +11:00
2020-12-04 09:18:01 +11:00
2020-12-04 09:18:01 +11:00
2020-12-04 09:18:01 +11:00
2020-12-04 09:18:01 +11:00
2020-12-04 09:18:01 +11:00

Try it now in CWS

Dialog Element

The WHATWG defines a new element called <dialog> that can be used to define modal and modeless dialogs within an HTML page. This example shows how to use this new element.

NOTE: This sample requires M31 or later in Chrome, and if necessary you might have to enable experimental web features in the chrome://flags page.

var dialog = document.querySelector('#dialog1');
document.querySelector('#show').addEventListener("click", function(evt) {
  dialog.showModal();
});
document.querySelector('#close').addEventListener("click", function(evt) {
  dialog.close("thanks!");
});

dialog.addEventListener("close", function(evt) {
  document.querySelector('#result').textContent = "You closed the dialog with: " + dialog.returnValue;
});

// called when the user Cancels the dialog, for example by hitting the ESC key
dialog.addEventListener("cancel", function(evt) {
  dialog.close("canceled");
});

Resources

Screenshot

screenshot