title: jQuery autocomplete with images
body: <p>I want to implement an autocomplete feature with images in my website.</p>
  
  <p>I would like to use the jQuery autocomplete plugin.</p>
  
  <p>I had a look at their sample code.</p>
  
  <p>Can anyone explain me what the below code means in $(document).ready() event:</p>
  
  <pre><code>$("#imageSearch").autocomplete("images.php", {
    width: 320,
    max: 4,
    highlight: false,
    scroll: true,
    scrollHeight: 300,
    formatItem: function(data, i, n, value) {
      return "&lt;img src='images/" + value + "'/&gt; " + value.split(".")[0];
    },
    formatResult: function(data, value) {
      return value.split(".")[0];
    }
  });
  </code></pre>
  
  <p>My ultimate requirement is when I type some letters in the text box, I want the options to come with an image associated with it.</p>