title: Creating a dialog JQuery Mobile
body: <p>I am trying to create a dialog with <code>Jquery mobile</code>. I have tried to refer to the accepted answer <a href="https://stackoverflow.com/questions/4488807/dialog-jquerymobile">in this SO question</a> but it didn't work for me. </p>
  
  <p>Here is my code:</p>
  
  <pre><code> &lt;div data-role="page" id="first"&gt; 
      &lt;!-- Code --&gt;  
      &lt;div id = "dialog" data-rel="dialog"&gt;
          &lt;div id = "errorText"&gt;&lt;/div&gt;
          &lt;button id = "closeDialog"&gt;OK&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And here is the JS to make it (inside a function):</p>
  
  <pre><code>//Nothing checked. Cannot continue. Add error message to div
  $('#errorText').html("You must check the checkbox next to \"I Agree\" to continue");
  //Open Dialog
  $('#dialog').dialog();
  </code></pre>
  
  <p>When the code to create the dialog is reached nothing happens. Suggestions?</p>