document.querySelectorAll('.skip-btn').forEach(function(btn) { btn.addEventListener('click', function(e) { var href = btn.getAttribute('href'); if (href && href.startsWith('#')) { var target = document.querySelector(href); if (target) { // Wait for scroll to finish setTimeout(function() { // Find first focusable element inside the target section var focusable = Array.from(target.querySelectorAll('a, button, input, textarea, select, [tabindex]:not([tabindex="-1"])')) .find(function(el) { return el.offsetParent !== null && !el.disabled && el.tabIndex !== -1; }); if (focusable) { focusable.focus(); } }, 400); // Adjust delay as needed } } }); });