title: create a pop-up window and display a list of radio buttons using javascript
body: <p>I'm writing on a js file.
  Here is what I've tried so far. (My code is a bit long but here is what I'm trying to do)</p>
  
  <pre><code>var popUpList= $ ('&lt;input type="radio"&gt;A&lt;br&gt; &lt;input type="radio"&gt;B&lt;br&gt; &lt;input type="radio"&gt;C');
  
  var showPopUpButton=$('&lt;button type="button"&gt;Select a Letter&lt;/button&gt;'); 
  // showPopUpButton is appended to the body
  showPopUpButton.click(function() {
        alert(popUpList);
     });
  </code></pre>
  
  <p>When I click on showPopUpButton, the alert window shows [object Object], which I guess means that the variable popUpList is empty.
  I couldn't find how to do that in javascript.</p>
  
  <p>I also tried with jQuery as suggested here <a href="https://stackoverflow.com/questions/11958531/create-a-popup-with-radio-box-using-js">Create a popup with radio box using js</a></p>
  
  <pre><code>var popUpList= $ ('&lt;input type="radio"&gt;A&lt;br&gt; &lt;input type="radio"&gt;B&lt;br&gt; &lt;input type="radio"&gt;C ');
      showPopUpButton.click(function() {
            popUpList.dialog();
         });
  </code></pre>
  
  <p>Now, the buttons are displayed but not inside a pop-up window! And they are all superposed. 
  Any help will be appreciated.</p>
  
  <p>Thanks!</p>