Can a synchronous input be done in JavaScript?
<p>I'm interested in the possibility of using JavaScript for an introductory language for students. The missing piece for me is the ability to provide a blocking equivalent to the input() command that is available in other languages.</p>

<p>Using console-only versions of JavaScript, like <a href="https://developer.mozilla.org/en/SpiderMonkey" rel="nofollow">SpiderMonkey</a>, would be a solution. SpiderMonkey has a readline() command. But I think the students would be more interested in code that ran inside a web browser. It would be nice if students could share with their friends their version of the classic "guess a number between 1 and 10" game.</p>

<p>The JavaScript window.prompt() command would also work, but the fact that it pops up a completely separate window isn't ideal. I'd like an in-document input field that works the same way. Is there such a solution?</p>
