tags:

views:

22

answers:

1

In Xul, how to call focus to an element after the window was loaded?

A: 

This page on Focus and Selection and this one On page load should help you out, I think.

window.addEventListener("load", function(){document.getElementById('ele-id').focus()}, false);

If the element is not focusable by default, then make it so with:

style="-moz-user-focus: normal;"

Make sense?

Erik Vold
I had forgoten the `document.` part when getting the element by id. In some parts it's not needed.. sad.. Thanks!
Tom Brito