Javascript 触发的关键点无效

Javascript 触发的关键点无效,javascript,jquery,geolocation,Javascript,Jquery,Geolocation,我想触发向下箭头键,然后按回车键。它会触发,但不会显示任何效果 在地理定位建议之后,我想移动第一个建议并启动enter键。请查看图片了解更多信息 function showPosition(position) { lat=position.coords.latitude; lng=position.coords.longitude; var latlng = new google.maps.LatLng(lat, lng); g

我想触发向下箭头键,然后按回车键。它会触发,但不会显示任何效果

在地理定位建议之后,我想移动第一个建议并启动enter键。请查看图片了解更多信息

   function showPosition(position) 
   {

      lat=position.coords.latitude; 
      lng=position.coords.longitude;
      var latlng = new google.maps.LatLng(lat, lng);

      geocoder = new google.maps.Geocoder();
      geocoder.geocode({'latLng': latlng}, function(results, status) 
      {
          if (status == google.maps.GeocoderStatus.OK) 
          {
             if (results[1])
             {
                var address= (results[1].formatted_address);
                document.getElementById('pick-auto').value=address;
                $('#pick-auto').focus();

                setTimeout(
                  function() 
                  {
                      var e = $.Event('keydown');
                      e.which = 40; // Character 'A'
                      $('#pick-auto').trigger(e);

                        var f = $.Event('keypress');
                        f.which = 13; // Character 'A'
                        $('#pick-auto').trigger(f);
                  }, 5000);
              }
         }
    });
  }

你的听众长什么样?它们是
onkeydown
还是例如
onkeypress
onpinput
?它们现在可以工作,但不起作用。谢谢你的回复。你的听众长什么样?它们是
onkeydown
还是例如
onkeypress
onpinput
?它们现在可以工作,但不起作用。谢谢你的回复。