title: Show results in popup
body: <p>This code is working fine to show results on the page itself but I want to show the results in a popup.</p>
  
  <p>We have linked the code to a database and it is retrieving the expected result, but how can I use jQuery to display division in a popup or dialogue box? Also it should be responsive.</p>
  
  <pre><code>      &lt;html&gt;&lt;head&gt;&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;title&gt;PHP, jQuery search demo&lt;/title&gt;&lt;link rel="stylesheet" type="text/css" href="my.css"&gt;&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;$(function() {
  
  $(".search_button").click(function() {
      // getting the value that user typed
      var searchString    = $("#search_box").val();
      // forming the queryString
      var data            = 'search='+ searchString;
  
      // if searchString is not empty
      if(searchString) {
          // ajax call
          $.ajax({
              type: "POST",
              url: "do_search.php",
              data: data,
              beforeSend: function(html) { // this happens before actual call
                  $("#results").html(''); 
                  $("#searchresults").show();
                  $(".word").html(searchString);
             },
             success: function(html){ // this happens after we get results
                  $("#results").show();
                  $("#results").append(html);
            }
          });    
      }
      return false;});});&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;div id="container"&gt;&lt;div style="margin:20px auto; text-align: center;"&gt;&lt;form method="post" action="do_search.php"&gt;&lt;input type="text" name="search" id="search_box" class='search_box'/&gt;&lt;input type="submit" value="Search" class="search_button" /&gt;&lt;br /&gt;&lt;/form&gt;&lt;/div&gt;&lt;div&gt;&lt;div id="searchresults"&gt;Search results :&lt;/div&gt;&lt;ul id="results" class="update"&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>