njpma/app/static/js/about.js

11 lines
No EOL
362 B
JavaScript

document.querySelectorAll('.accordion-checkbox').forEach(cbox => {
cbox.addEventListener('change', function() {
const label = this.previousElementSibling
const caret = label.querySelector('.text')
if (cbox.checked) {
caret.innerHTML = '▼'
} else {
caret.innerHTML = '▶'
}
})
})