Difference between revisions of "ARIA Live"

From Level Access Web Labs
Jump to navigation Jump to search
(Created page with "<html> <head> ... <script> var result1 = 0; function update1() { result1 = result1 + 1; document.getElementById("result1").innerHTML=result1; } </script> </head> <body> ....")
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
This approach uses a change to inner HTML.  Activate the update result button to display a new value in the ARIA live region.
 +
 
<html>
 
<html>
 
<head>
 
<head>
Line 6: Line 8:
 
var result1 = 0;
 
var result1 = 0;
  
function update1() {
+
function update() {
 
result1 = result1 + 1;
 
result1 = result1 + 1;
 
document.getElementById("result1").innerHTML=result1;
 
document.getElementById("result1").innerHTML=result1;
 +
}
 +
function auto() {
 +
  setTimeout(function(){update()});
 +
  setTimeout(function(){auto()},2000);
 
}
 
}
 
</script>
 
</script>
Line 18: Line 24:
  
 
<div>
 
<div>
<button onclick="update1();">Update result 1</button>
+
<button onclick="update();">Update result</button>
 +
<button onclick="auto();">Auto Update result</button>
 
</div>
 
</div>
 
...
 
...
 
</body>
 
</body>
 
</html>
 
</html>
 +
[[Category:ARIA]]

Latest revision as of 01:53, 10 November 2018

This approach uses a change to inner HTML. Activate the update result button to display a new value in the ARIA live region.

... ...

...