I am wondering how to remove the automatic focus which automatically happens to the first anchor tag on page load.
I am not looking to disable all focus ability which is pretty much all I was able to find solutions to while researching this question. The focus should still apply and show when an anchor is clicked.
Here is the css (scss in this case) for the focus itself, which I want to remain.
&:focus {
outline:3px solid #51ace9
}
I have tried doing something like this to get rid of the auto focus on page load:
window.onload= function() {
var anchors = document.getElementsByClassName('my_class')
for (var i = 0; i < anchors.length; i++) {
anchors[i].blur();
}
}
but it doesn't seem to work.
Can someone suggest a proper solution?