key-space-single-summary.html 672 B

12345678910111213141516171819202122
  1. <!DOCTYPE html>
  2. <!-- Any copyright is dedicated to the Public Domain.
  3. - http://creativecommons.org/publicdomain/zero/1.0/ -->
  4. <html class="reftest-wait">
  5. <script>
  6. function runTest() {
  7. var summary = document.getElementById("summary");
  8. // Dispatch 'space' keys to the summary element.
  9. summary.dispatchEvent(new KeyboardEvent("keydown", {"keyCode": 32}));
  10. summary.dispatchEvent(new KeyboardEvent("keyup", {"keyCode": 32}));
  11. document.documentElement.removeAttribute("class");
  12. }
  13. </script>
  14. <body onload="runTest();">
  15. <details>
  16. <summary id="summary">Summary</summary>
  17. <p>This is the details.</p>
  18. </details>
  19. </body>
  20. </html>