jQuery autoComplete view all on click?

后端 未结 22 1864
北恋
北恋 2020-12-02 09:52

I\'m using jQuery\'s autocomplete in a relatively simple way:

$(document).ready(function() {
  var data = [ {text: \"Choice 1\"}, 
               {text: \"Ch         


        
相关标签:
22条回答
  • 2020-12-02 10:28
     $j(".auto_complete").focus(function() { $j(this).keydown(); })
    
    0 讨论(0)
  • 2020-12-02 10:28

    When input value is empty search else the value inside input. This code works for me:

    $("#your_input").on('focus', function () {
       $(this).autocomplete('search', $(this).val() == '' ? " " : $(this).val());    
    });
    
    0 讨论(0)
  • 2020-12-02 10:29

    you can use this:

    $("#example").autocomplete( "search",  $("#input").val() );
    
    0 讨论(0)
  • 2020-12-02 10:30

    You can also use search function without parameters:

    jQuery("#id").autocomplete("search", "");
    
    0 讨论(0)
提交回复
热议问题