How can I focus an text input when it is visible which is probably before the whole DOM is ready? I only have to possibility to run a script before the DOM started loading. The reason I want to do this is that the user wants to start typing until the input is visible and loading the DOM takes a while.

I would like to do it with jQuery. 

Greetings!