JSFiddle - React, Tailwind, and code Playground
by rvrjp7
HTML
<!DOCTYPE html>
<html>
<body>
<h2>The Button Element</h2>
<div>
Click focus button and wait for 3 seconds then press spacebar after all text in dialog is read by NVDA
</div>
<button type="button"style="display:block" onclick="myFunction()">Focus</button>
<div id="dlg"tabindex="0" role="dialog" style="display:none;border:1px solid black; height:100px; width:100px">
<div id="dlg_heading">
Dialog Heading
</div>
<div id="btn_container"style="float:left">
<button id="temp1" style="display:block"type="button" onclick="alert('button 1 clicked')">button 1</button>
<button type="button" onclick="alert('button 2 clicked')">button 2</button>
</div>
</div>
<script>
function myFunction() {
setTimeout(function(){ document.getElementById("dlg").style.display="block"; document.getElementById("temp1").focus(); }, 3000);
}
</script>
</body>
</html>