Read the script at the bottom of the page. Open the Console (Cmd/Ctrl + Shift + J) and watch what prints.
One button, one box. The class does the styling; JS just switches it on and off.