Difference between revisions of "ARIA Alert Dialog"

From Level Access Web Labs
Jump to navigation Jump to search
Line 1: Line 1:
<nowiki>
 
 
<html lang="en">
 
<html lang="en">
 
<head>
 
<head>
Line 83: 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' && event.keyCode == 27) {
+
if (document.getElementById('alert-dialog').display != 'none' &amp;&amp; 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';
Line 130: Line 129:
 
</body>
 
</body>
 
</html>
 
</html>
</nowiki>
 
 
[[Category:ARIA]]
 
[[Category:ARIA]]

Revision as of 19:00, 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.