I recently built a simple retro snake game in javascript, with the game rendered on an HTML canvas and hi-scores in HTML local storage. You can play it online, or grab the source from github.

Update: I've written a CoffeeScript version too, the source is on github.