I love JavaScript, but that HTMJS page has to be a joke. Putting that much JavaScript inside an inline onclick event attribute is pretty ridiculous. It's like a blog for how not to use JavaScript.
It's easy to find the code that does something, easy to understand what it does and easy to modify it to do something else.
Sure, I wouldn't want to maintain an app with thousands of lines of HTML and JavaScript that works like that, but for a single simple feature on a page that isn't doing anything else I don't see the problem.