What is the best way to simulate a DOS screen or terminal on a web page?

I find it hard to even conceptualize. An easy way would be for a large textarea occupy most of the screen, with a small input text element below it. The player will enter commands, and the output will be displayed in textarea .

The problem is that I want the input to be fully integrated. Think of the DOS screen. The prompt, > , after which you enter the command. Press "Enter", then the output will be displayed, and then another command > for the next command. The entrance is not separate, visually, from the exit. An example of what I would like to do can be seen here: http://www.youtube.com/watch?v=UC_FrikiZdE (except that instead of the mouse we select commands, they can be entered).

How will I do this in HTML (using JavaScript / jQuery to handle I / O)? I think it’s possible that everything was done in an editable textarea , but the Backspace button cannot erase anything from the > prompt and beyond, only the text that was entered.

What is the easiest way to do this? I could not find any demos or tutorials on the Internet. Can someone point me to what I might have missed? Thanks.

+8
javascript jquery html php
source share
1 answer

You can check out these JavaScript terminals found through Google:

In addition, some of my French friends are working on this:

+12
source share

All Articles