I found this Commodore 64 JavaScript Emulator, written by Thomas Hochgoetz, at c64emulator.111mb.de. I've installed it here so I could experiment with getting it to work online — and demonstrate some of the games and other software I wrote back in the days when a Commodore 64 was affordable, and a "PC" was not.
The easiest way to play a game is to load one of the pre-saved snapshots of the vintage Commodore 64 games I wrote, from the SNAPSHOTS drop-down menu below the main emulator screen.
Currently there's two games, plus a morse code practice program, that you can play from the SNAPSHOTS menu. You can also load any other of the standard Commodore 64 file formats (e.g. the .D64 file type which is a Commodore 64 floppy disk image file) by dragging them into the DROP FILE panel.
NOTE THAT ON PHONES and other touch-screen devices, to scroll the screen when the emulator is in the middle, you have to touch the white borders outside the emulator window itself
More information is given further down this page underneath the simulator window itself...
You will probably have to turn on the sound by clicking on the "Sound" button.