title: How can I make a program wait for a button press in javascript?
body: <p>I need to modify some legacy javascript code. There's a place where I want to wait until the user presses one of two buttons and then continue with the program flow (like <code>prompt()</code> function). How can this be achieved ?</p>