You can develop an HTML5 game from scratch, but it will be more convenient and easier to do it using numerous engines and frameworks. Here are just a few of them:
A framework for developing 2D games, it is intended not only for professional developers, but also for people who cannot code: designers, artists or students. More than 20 plugins and 70 visual effects are available to create a game that can then be published immediately to multiple platforms. Construct 2 can be tried for free, and the full version of the tool costs 6,299.9 rubles.
The free open source engine allows you to create games using Canvas and the WebGL library. There are many examples and tutorials available on the Phaser website to help you create your own game.