Put JS in the <body>

Putting Javascript in the <head> is usually a bad idea, because anything in the <head> must be completed before the <body> is being loaded.
Because of performance, it makes sense to use this solution.