Is it really necessary to wait for the \"ready\" (or \"window.onload\") events if your code only manipulates DOM elements that have already been parsed entirely?
The
Yes, it's safe if you js code is after dom but usually it's not relly good idea to mix html and js.