Difference between revisions of "JavaScript Prompt"

From Level Access Web Labs
Jump to navigation Jump to search
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<html>
 
<html>
 
<script>
 
<script>
document.getElementById("b1").addEventListener("click",showPrompt)
+
document.addEventListener('DOMContentLoaded', function() {
 +
  document.getElementById("b1").addEventListener("click",showPrompt);
 +
});
 +
 
 
function showPrompt() {
 
function showPrompt() {
 
   var pizza = prompt("Please enter your Fav Pizza", "Veggie, cheese, etc.");
 
   var pizza = prompt("Please enter your Fav Pizza", "Veggie, cheese, etc.");
   if (person != null) {
+
   if (pizza != null) {
     document.getElementById("demo").innerHTML =
+
     document.getElementById("output").innerHTML =
     "Hello you like " + pizza + " ";
+
     "Hello! You like " + pizza + " pizza";
 
   }
 
   }
 
}
 
}
Line 12: Line 15:
 
<body>
 
<body>
 
<button id="b1">Display prompt</button>
 
<button id="b1">Display prompt</button>
 +
<div id="output"></div>
 
</body>
 
</body>
 
</html>
 
</html>
 +
==Results==
 +
*JAWS and Firefox When the Display Prompt button was activated, the dialog content was announced Automatically. It is possible to enter text into the edit field. This also occurs with Chrome and Internet explorer.
 +
*NVDA and Firefox When the Display Prompt button was activated, the dialog content was announced Automatically. It is possible to enter text into the edit field. This also occurs with Chrome and Internet explorer.
 +
*VoiceOver with iOS: When the Display Prompt button was activated, the dialog content was announced Automatically. It is possible to enter text into the edit field.
 +
*TalkBack with Chrome, When the Display Prompt button was activated, the dialog content Please Enter Your Fav Pizza, was not announced Automatically. It is possible to Swipe to this text. It is possible to enter text into the edit field.

Latest revision as of 17:24, 11 February 2019

Results

  • JAWS and Firefox When the Display Prompt button was activated, the dialog content was announced Automatically. It is possible to enter text into the edit field. This also occurs with Chrome and Internet explorer.
  • NVDA and Firefox When the Display Prompt button was activated, the dialog content was announced Automatically. It is possible to enter text into the edit field. This also occurs with Chrome and Internet explorer.
  • VoiceOver with iOS: When the Display Prompt button was activated, the dialog content was announced Automatically. It is possible to enter text into the edit field.
  • TalkBack with Chrome, When the Display Prompt button was activated, the dialog content Please Enter Your Fav Pizza, was not announced Automatically. It is possible to Swipe to this text. It is possible to enter text into the edit field.