title: Jquery UI autocomplete. How to write the results inside a div using innerHTML?
body: <p>I have an autocomplete field into my website. I just want to display the results inside a -div- tag instead the popup window that the plugin opens natively.</p>
  
  <p>I searched already for solutions for this in other posts, but what they do is to change the position of the "popup" window, and what I want is to replace the content of the -div- with the results, not to put the popup over it.</p>
  
  <p>Any advice will be very appreciated.</p>
  
  <p>This is the code that I have:</p>
  
  <pre><code>&lt;!doctype html&gt;
  
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;jQuery UI Autocomplete - Default functionality&lt;/title&gt;
      &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" /&gt;
      &lt;script src="http://code.jquery.com/jquery-1.8.2.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="/resources/demos/style.css" /&gt;
      &lt;script&gt;
      $(function() {
          var availableTags = [
              "ActionScript",
              "AppleScript",
              "Asp",
              "BASIC",
              "C",
              "C++",
              "Clojure",
              "COBOL",
              "ColdFusion",
              "Erlang",
              "Fortran",
              "Groovy",
              "Haskell",
              "Java",
              "JavaScript",
              "Lisp",
              "Perl",
              "PHP",
              "Python",
              "Ruby",
              "Scala",
              "Scheme"
          ];
          $( "#tags" ).autocomplete({
              source: availableTags
          });
      });
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div class="ui-widget"&gt;
      &lt;label for="tags"&gt;Tags: &lt;/label&gt;
      &lt;input id="tags" /&gt;
  &lt;/div&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>.</p>
  
  <p><img src="https://i.stack.imgur.com/FzLe4.png" alt="Example"></p>