virtuallypotato/assets/js/custom.js

13 lines
334 B
JavaScript
Raw Normal View History

// Make the collapsible content accessible
let myLabels = document.querySelectorAll('.lbl-toggle');
Array.from(myLabels).forEach(label => {
label.addEventListener('keydown', e => {
// 32 === spacebar
// 13 === enter
if (e.which === 32 || e.which === 13) {
e.preventDefault();
label.click();
};
});
});