virtuallypotato/assets/js/custom.js

14 lines
335 B
JavaScript
Raw Permalink 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();
};
});
});