title: jQuery UI autocomplete widget - how to get a reference to the menu?
body: <p>I want to be able to get a reference to the menu object that autocomplete builds, (so I can get the <code>.attr(&quot;id&quot;)</code> for example), but I'm not very familiar with jQuery/javascript. In the source, I found this:</p>
  <p><a href="https://github.com/jquery/jquery-ui/blob/1-9-stable/ui/jquery.ui.autocomplete.js#L182" rel="nofollow noreferrer">https://github.com/jquery/jquery-ui/blob/1-9-stable/ui/jquery.ui.autocomplete.js#L182</a></p>
  <p>so there is an object flying around, I just can't seem to find how to get hold of it.</p>
  <p>So, for example, if I've got an input with an autocomplete bound to it like this:</p>
  <pre><code>// input = reference to the input text box on the form
  input.autocomplete({
    select: function(event, ui) {
      // how to get the reference here?
  
      // some things I've tried
      // return input.menu
      // return input.data(&quot;menu&quot;)
      // and a few others but they didn't work either
    }
  });
  </code></pre>
  <p>I tried looking at the data object itself, but there were so many options I could spend all day looking at it and still not find what I'm looking for.</p>