Change Tabindex to 0

Have more questions? Submit a request

For accessability reasons we have added tabindexes greater than 0 to our banner, the reason being is that we feel that users should be able to interact with the Cookiebanner as soon as they land on the website to create the best user experience and not to be hindered by the cookiebanner while browsing the website. 

However, in some cases you might want to alter this behaviour, with the help of the script below we can reset the tabindexes for the cookiefirst elements back to 0. 

 

<script>
window.addEventListener("cf_layer_ready", function(event) {
var element = event.detail;

// Now, you can execute the code to change tabindex here
var elements = element.querySelectorAll('.cookiefirst-root *');

for (var i = 0; i < elements.length; i++) {
elements[i].tabIndex = 0;
}
});
</script>

Articles in this section

Was this article helpful?
1 out of 2 found this helpful
Share