title: how to get value of selected item in autocomplete
body: <p>i have here a code from <a href="http://jqueryui.com/autocomplete/" rel="noreferrer">http://jqueryui.com/autocomplete/</a> it works really good but i cant find a way to get the value of selected item in the text view i tried something like this but its not working </p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function () {
      $('#tags').change(function () {
          $('#tagsname').html('You selected: ' + this.value);
      }).change();
  });
  &lt;/script&gt;
  
  &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.10.3/themes/smoothness/jquery-ui.css" /&gt;
    &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
    &lt;script src="http://code.jquery.com/ui/1.10.3/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;script&gt;
  $(document).ready(function () {
      $('#tags').change(function () {
          $('#tagsname').html('You selected: ' + this.value);
      }).change();
  });
  &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 id="tagsname"&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>