Dialog Element Example
Item media 1 screenshot

Overview

Dialog Element The WHATWG defines a new element called <dialog> that can be used to define modal and modeless dialogs within an…

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. ```javascript 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"); }); ``` See the source code at https://github.com/GoogleChrome/chrome-app-samples/tree/master/dialog-element This version was built from git commit b3949bf https://github.com/GoogleChrome/chrome-app-samples/tree/b3949bf/dialog-element

0 out of 5No ratings

Google doesn't verify reviews. Learn more about results and reviews.

Details

  • Version
    2
  • Updated
    September 2, 2014
  • Offered by
    Chrome App Samples
  • Size
    4.99KiB
  • Languages
    English (United States)
  • Non-trader
    This developer has not identified itself as a trader. For consumers in the European Union, please note that consumer rights do not apply to contracts between you and this developer.

Privacy

The developer has not provided any information about the collection or usage of your data.

Support

For help with questions, suggestions, or problems, visit the developer's support site

Related

Similarweb - Traffic Rank & Website Analysis

4.6(2.8K)

Instant website analysis, including site rank, site traffic, sources and geography.

SEOquake

4.6(2.5K)

SEOquake is a free plugin that provides you with key SEO metrics, along with other useful tools such as SEO Audit and many others

Clear Cache

4.5(1.1K)

Clear your cache and browsing data with a single click of a button.

Tag Assistant Companion

2.7(109)

The Tag Assistant Companion extension works with Tag Assistant to help troubleshoot installation of gtag.js and Google Tag Manager.

GoFullPage - Full Page Screen Capture

4.9(73.2K)

Capture a screenshot of your current page in entirety and reliably—without requesting any extra permissions!

ColorZilla

4.5(3.2K)

Advanced Eyedropper, Color Picker, Gradient Generator and other colorful goodies

JSON Formatter

4.6(1.8K)

Makes JSON easy to read. Open source.

User-Agent Switcher for Chrome

3.9(2.6K)

Spoofs & Mimics User-Agent strings.

Proxy SwitchyOmega

4.6(3.8K)

Manage and switch between multiple proxies quickly & easily.

Redux DevTools

4.6(693)

Redux DevTools for debugging application's state changes.

Cookie-Editor

4.5(273)

Simple yet powerful Cookie Editor that allow you to quickly create, edit and delete cookies without leaving your tab.

Lighthouse

4.4(295)

Lighthouse is an open-source, automated tool for improving the performance, quality, and correctness of your web apps.

Similarweb - Traffic Rank & Website Analysis

4.6(2.8K)

Instant website analysis, including site rank, site traffic, sources and geography.

SEOquake

4.6(2.5K)

SEOquake is a free plugin that provides you with key SEO metrics, along with other useful tools such as SEO Audit and many others

Clear Cache

4.5(1.1K)

Clear your cache and browsing data with a single click of a button.

Tag Assistant Companion

2.7(109)

The Tag Assistant Companion extension works with Tag Assistant to help troubleshoot installation of gtag.js and Google Tag Manager.

GoFullPage - Full Page Screen Capture

4.9(73.2K)

Capture a screenshot of your current page in entirety and reliably—without requesting any extra permissions!

ColorZilla

4.5(3.2K)

Advanced Eyedropper, Color Picker, Gradient Generator and other colorful goodies

JSON Formatter

4.6(1.8K)

Makes JSON easy to read. Open source.

User-Agent Switcher for Chrome

3.9(2.6K)

Spoofs & Mimics User-Agent strings.

Google apps