With the following code I try to give an a element autofocus when the page is loaded.
<a href="/{{setting}}" id="next" class="button big active">Next vocabulary</a>
<script>
document.getElementbyId("next").focus();
</script>
Whilst this works fine with input fields it doesn’t work with that a element. Can anybody explain me while?
Regards
The problem is that you typed
getElementByIdwrong, it should be an uppercase ‘B’.This should now work!