This is jsnes. And this is a bit of my reasoning for wanting to do it.
So, I first thought of straight js simulation, but that's probably impossible. Why bother, anyway? I've got all source locally, I should have direct access to jsnes methods. And I sure do. Going on the console and typing
self.nes.stop() works wonders. Found about it by looking at jsnes.js compiled source and toying with console auto completion.
I'm in a bit of a rush, needing to focus in doing just 1 thing to get my project started, and trying to not waste time in going too deep into learning few things like this, which should be obvious to a lot of people!
Usually I'd ask this on SO, but the community there is harsh and would probably not enjoy this question. Or understand it. Or care. I think.
My current failed attempt is around these lines:
Anyway, can anyone give any help?
If you think you can, it's "just" a matter of going to the jnes website, opening up the console, and figuring out how to call its keyboard!