title: AutoComplete in jQuery with dynamically added elements
body: <p>My requirement is to show few options when user input some characters (minimum 3) in one of input field which might be added dynamically too. </p>
  
  <p>I can not load data at page loading at beginning because data is huge. There is an ajax call to get that filtered data.</p>
  
  <p>The issue what I am getting is <code>Expected identifier</code> error on page loading at line# 2. So, could you please tell what is wrong with the below code?</p>
  
  <pre><code>$(document).on('keydown.autocomplete', 'input.searchInput', function() {                
              source: function (request, response) { // Line # 2
              var id = this.element[0].id;
  
              var val = $("#"+id).val();             
              $.ajax({                     
                      type : 'Get',
                      url: 'getNames.html?name=' + val,
                      success: function(data) {
                          var id = $(this).attr('id');
                          $(this).removeClass('ui-autocomplete-loading'); 
                          response(data);
                      },error: function(data) {
                            $('#'+id).removeClass('ui-autocomplete-loading');  
                      }
                    });
                },
                  minLength: 3
              });
  </code></pre>