title: Get the selected value in jquery autocomplete on blur function
body: <p>I want to have auto complete functionality, where the text-box should get populated with the value list as a first item when there is an blur event.</p>
  
  <p>I would like to have the functionality same as implemented in this link <a href="http://www.redbus.in/" rel="nofollow noreferrer">link</a></p>
  
  <p><img src="https://i.stack.imgur.com/LrvcG.png" alt="enter image description here"></p>
  
  <p>I have the code below, which populates on tab and enter key, but dont know how to achieve same functionality on blur event.</p>
  
  <pre><code>$( "#statelist" ).autocomplete({
      autoFocus: true,
      source: states,
      select: function (event, ui) {
          stateid = (ui.item.lable);
          $("#stateid").val(stateid);
      }
  });
  </code></pre>
  
  <p>EDIT :-
  user enters a text lets us say type "che" and without pressing tab or enter key, user moves his control to next textbox, in this scenario I want the first list item to populated automatically in the textbox. </p>