Thanks for that, leatherback. That's a start. I'm actually currently quite clueless about JavaScript (and no PHP wizard either), but, hey, I've got a fair amount of curiosity and I can RTFM.
What I'm trying to do here --and please don't laugh, it's a mental idea-- is this:
You may know the site http://command.com.
They just use an animated gif there.
Seeing that site set me off thinking: What if one could build a web site that would really have a working DOS command line as its user interface? (It would almost be an in-joke now, as less and less people grow up knowing any DOS at all.)
It's gotta emulate a 80x25 DOS screen, using the standard text font (probably to be pieced together using a 80x25 table of little .pngs or similar). The backend's gotta be PHP, I've pretty much settled on that. But just using a single <form> input line to submit commands isn't good enough. I'm still looking for a way to capture keystrokes in some other way.
And yes, I know it is a crackbrained idea. Thanks for telling me.
Any further hints and pointers GREATLY appreciated.