Difference between revisions of "ARIA Alert Dialog"

From Level Access Web Labs
Jump to navigation Jump to search
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' <nowiki>&&</nowiki> event.keyCode == 27) {
+
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

ARIA AlertDialog Example

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.