diff --git a/src/code-collapse/index.html b/src/code-collapse/index.html index 0057d3a..29bf930 100644 --- a/src/code-collapse/index.html +++ b/src/code-collapse/index.html @@ -6,12 +6,13 @@

Here's some content before

- +
This is the inner content

Text below the collapse, which should move out the way

+ diff --git a/src/code-collapse/index.js b/src/code-collapse/index.js new file mode 100644 index 0000000..b055d6f --- /dev/null +++ b/src/code-collapse/index.js @@ -0,0 +1,10 @@ +const collapse = document.getElementById("collapse"); + +document.addEventListener("DOMContentLoaded", function () { + // Force checkboxes to their initial value + for (const checkbox of this.document.querySelectorAll( + "input[type=checkbox", + )) { + checkbox.checked = checkbox.defaultChecked; + } +});