summary refs log tree commit diff stats
path: root/script.js
blob: 01458c96f8b2140fb34aa81bc5b19f0af2394e60 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Toggle all <details> on the page (thanks elioat!)

const toggleDetails = () => {
	document.body.querySelectorAll("details").forEach((e) => {
		if (!e.classList.contains("info")) {
			e.hasAttribute("open")
				? e.removeAttribute("open")
				: e.setAttribute("open", true);
		}
	});
};