1290904.html 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <fieldset id="outer">
  5. <fieldset id="inner">
  6. </fieldset>
  7. </fieldset>
  8. </body>
  9. </html>
  10. <script>
  11. function appendTextareaToFieldset(fieldset) {
  12. var textarea = document.createElement("textarea");
  13. textarea.setAttribute("required", "");
  14. fieldset.appendChild(textarea);
  15. }
  16. var innerFieldset = document.getElementById('inner');
  17. var outerFieldset = document.getElementById('outer');
  18. var fieldset = document.createElement('fieldset');
  19. appendTextareaToFieldset(fieldset);
  20. appendTextareaToFieldset(fieldset);
  21. appendTextareaToFieldset(fieldset);
  22. appendTextareaToFieldset(fieldset);
  23. // Adding a fieldset to a nested fieldset.
  24. innerFieldset.appendChild(fieldset);
  25. appendTextareaToFieldset(fieldset);
  26. appendTextareaToFieldset(fieldset);
  27. // This triggers mInvalidElementsCount checks in outer fieldset.
  28. appendTextareaToFieldset(outerFieldset);
  29. // Removing a fieldset from a nested fieldset.
  30. innerFieldset.removeChild(fieldset);
  31. // This triggers mInvalidElementsCount checks in outer fieldset.
  32. appendTextareaToFieldset(outerFieldset);
  33. </script>