dynamic-add-details.html 855 B

1234567891011121314151617181920212223242526272829
  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. // Append open <details> into <body>
  8. var summary = document.createElement("summary");
  9. var summary_text = document.createTextNode("Summary");
  10. summary.appendChild(summary_text);
  11. var paragraph = document.createElement("p");
  12. var details_text = document.createTextNode("This is the details.");
  13. paragraph.appendChild(details_text);
  14. var details = document.createElement("details");
  15. details.appendChild(summary);
  16. details.appendChild(paragraph);
  17. details.open = true;
  18. document.body.appendChild(details);
  19. document.documentElement.removeAttribute("class");
  20. }
  21. </script>
  22. <body onload="runTest();">
  23. </body>
  24. </html>