Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<html>
<head>
<title>ARIA Notify API Test: Document Announcement</title>
<link rel="help" href="https://github.com/w3c/aria/pull/2577">
<link rel="author" title="Jacques Newman" href="mailto:janewman@microsoft.com">
</head>
<body>
<h1>ARIA Notify API Test: Document Announcement</h1>
<p>This test checks the behavior of the <code>ariaNotify</code> API with a
simple announcement on the document object.</p>
<h2>Setup Instructions</h2>
<p><strong>Setup:</strong> Use a screen reader (NVDA, JAWS, VoiceOver, etc.) or other assistive technology that
supports the ARIA Notify API.</p>
<p><strong>Instructions:</strong> Click the "Run Test" button and listen for the announced text from your screen reader.</p>
<script>
function tryCallAriaNotify(element, message, options = {}) {
if (element.ariaNotify) {
element.ariaNotify(message, options);
return 'ariaNotify called' + ` with message: "${message}" and options: ${JSON.stringify(options)}`;
} else {
return 'the ariaNotify API is not supported in this browser';
}
}
</script>
<div>
<h3>Test: Simple Announcement</h3>
<p><strong>Expected:</strong> Screen reader should announce "Hello, world!" using default priority (normal).</p>
<button onclick="test()">Run Test</button>
<div id="status"></div>
<script>
function test() {
document.getElementById('status').textContent = tryCallAriaNotify(document, 'Hello, world!');
}
</script>
</div>
</body>
</html>