JSMESS is an attempt to port MESS / MAME to JavaScript using Emscripten.
Jason Scott says it best:
The MESS program can emulate (or begin to emulate) a majority of home computers, and continues to be improved frequently. By porting this program into the standardized and cross-platform Javascript language, it will be possible to turn computer history and experience into the same embeddable object as movies, documents, and audio enjoy.
Jason Scott's JSMESS site has demos for most working systems now. JSMESS is now tracking the latest versions of MESS, and sound and joystick support work in many cases.
To build JSMESS 0.151+, start with How to build and test JSMESS 0.151.