diff --git a/modules/helfi_toc/assets/js/tableOfContents.js b/modules/helfi_toc/assets/js/tableOfContents.js index 5e3e03070..12d6cef61 100644 --- a/modules/helfi_toc/assets/js/tableOfContents.js +++ b/modules/helfi_toc/assets/js/tableOfContents.js @@ -181,6 +181,8 @@ } // Create anchor links. content.setAttribute('id', anchorName); + content.setAttribute('tabindex', '-1'); // Set tabindex to -1 to avoid issues with screen readers. + content.setAttribute('class', 'toc-focusable'); }); if (tableOfContents) {