mirror of
https://github.com/jbowdre/virtuallypotato.git
synced 2024-11-30 18:32:17 +00:00
13 lines
335 B
JavaScript
13 lines
335 B
JavaScript
// 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();
|
|
};
|
|
});
|
|
});
|