Yeah it is better, but not objectively better in all cases - having JS inlined in HTML saves the server & client the overhead of one extra HTTP request, so if it's really short and there's no advantage to be gained from caching because the code is not being re-used in other pages, then it's not really worth it for any other reason than keeping the code clean.

Anyway, for the sake of keeping the code clean, I will have a clean-up session some time and move the inline JS and CSS out into separate files.