When using the JavaScript focus() method to set focus to an input element in FireFox, the following error may be produced:
Permission denied to set property xulelement.selectedIndex
This is a known bug in FireFox which, based on my research, was supposed to be fixed several versions ago. To avoid this error, autocomplete needs to be turned off for the element in question. This can be accomplished:
Via JavaScript, using element.setAttribute('autocomplete','off');
Or
Via HTML using autocomplete=”off”.
I have read that this error is also produced with the JavaScript select() method but have been unable to reproduce it.