For anyone following this with a recent version of Unity (e.g. the 2023.x and 6.x branches), note that there is no longer a "WebGL" platform, but just "Web" instead.
Also the menu structure has changed. After switching to the "Web" platform, o apply the template you now need to go to:
Edit -> Project Settings -> Player, and select "BetterMinimal" template under the Resolution and Presentation heading.