title: Create a popup window in plain javascript
body: <p>In a specific page a user will press a button but on button press <em>before</em> the actual processing, I need occasionally to present to the user a list of <code>options</code> to select the appropriate one and use that selection in order to be able to proceed the processing.<br>
  So essentially I need to display a pop-up window that shows a <code>select</code> box with available options and get the user's selection and <em>then</em> continue processing.<br>
  So to do this I found that I need a combination of <code>window-&gt;open/prompt/showModalDialog</code><br>
  I found a way to present a pop-up window to the user with the options via  </p>
  
  <pre><code>var newWindow = window.open("", null, "height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");  
  newWindow.document.write("&lt;select&gt;");   
  newWindow.document.write("&lt;option&gt;");  
  newWindow.document.write(obj);  
  newWindow.document.write("&lt;/option&gt;");  
  newWindow.document.write("&lt;/select&gt;");  
  </code></pre>
  
  <p>Example for passing just one option.<br>
  But I can not seem to find how to get back the selection.<br>
  The <code>prompt</code> on the other hand returns the selection, but I don't think I can make it display my <code>select</code>.<br>
  The <code>showModalDialog</code> returns the selection, but seems to expect another web page as a parameter. So it is not suitable for me.  </p>
  
  <p>How can I create my pop-up using plain javascript?</p>