Difference between revisions of "ARIA Alert Dialog"
Jump to navigation
Jump to search
ARIA AlertDialog Example
Line 82: | Line 82: | ||
// This is the default behavior of a modal dialog | // This is the default behavior of a modal dialog | ||
document.addEventListener("keydown", function(event) { | document.addEventListener("keydown", function(event) { | ||
− | if (document.getElementById('alert-dialog').display != 'none' | + | if (document.getElementById('alert-dialog').display != 'none' && event.keyCode == 27) { |
document.getElementById('alert-dialog').style.display = 'none'; | document.getElementById('alert-dialog').style.display = 'none'; | ||
document.getElementById('modal-overlay').style.display = 'none'; | document.getElementById('modal-overlay').style.display = 'none'; |
Revision as of 19:02, 20 June 2014
This code works but doesn't work in the wiki because wiki markdown doesn't like double ampersands. If you copy this code into a local HTML file it will work fine.