title: Open an UI Dialog on click of a button in JQuery
body: <p>My previous qstn in this forum was about assigning text dynamically to buttons in jquery dynamically and I got solution for that here. Now my question is, upon clicking that button, I have to open another UI dialog with 2 buttons. I have written the following code. I am able to open UI Dialog but buttons are not appearing. Pls help me to alter my code.</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt; 
          &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
          &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="selector" title="Pop Up" class = "selector"&gt; &lt;p&gt;&lt;span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"&gt;&lt;/span&gt; Do u want to save the score?&lt;/p&gt; &lt;/div&gt;
          &lt;script&gt;
          var monthNames = ["January", "February", "March", "April", "May", "June",                    "July", "August", "September", "October", "November", "December"];
          var today = new Date();
          var month = monthNames[today.getMonth()];
          var nextMonth = monthNames[today.getMonth() + 1];
  
          $(".selector").dialog({buttons: [
                  {
                      text: month,
                      click: function() {
                       $("#opener").dialog({modal: true, height: 590, width: 1005 });
                          $(this).dialog("close");
                      }
                  },
                  {
                      text: nextMonth,
                      click: function() {
                          $(this).dialog('close');
                      }
                  }
              ]});
  
          &lt;/script&gt;
          &lt;script&gt;
  
            $(".opener").dialog({buttons: [
                  {
                      text: "ok",
                      click: function() {
                          $(this).dialog("open");
                      }
                  },
                  {
                      text: "cancel",
                      click: function() {
                          $(this).dialog('open');
                      }
                  }
              ]});
  
      &lt;/script&gt;
  
      &lt;div id="opener" title="Pop Up" class = "opener" width ="100px"&gt; 
      &lt;p&gt;&lt;span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"&gt;&lt;/span&gt;
      Score will be updated&lt;/p&gt; &lt;/div&gt;
  
  
  &lt;/body&gt;
  </code></pre>
  
  <p></p>