-2

What events are triggered when the user selects an input option from a datalist autocomplete?

I.e. how can I run some code immediately after the user has selected a suggestion?

user1277170
  • 3,127
  • 3
  • 19
  • 19
  • 2
    what datalist are you talking about? Do you mean `INPUT` element autofill list? If ya, see there: http://stackoverflow.com/questions/11708092/detecting-browser-autofill There are some shitty workarounds though, using interval e.g – A. Wolff Mar 03 '14 at 15:00
  • "after the user has selected" I'm not sure the datalist is relevant here, but rather your . See http://api.jquery.com/change/ – Clint Mar 03 '14 at 15:01
  • @A.Wolff I mean HTML5 http://www.w3schools.com/tags/tag_datalist.asp @ Clint Change only triggers on blur. – user1277170 Mar 03 '14 at 15:05
  • 1
    @user1277170 i didn't know this one. You should have posted relevant code in question – A. Wolff Mar 03 '14 at 15:07

1 Answers1

1

oninput event is fired:

SEE DEMO

$('input').on('input', function(){
    //...
});
A. Wolff
  • 74,033
  • 9
  • 94
  • 155
  • 1
    Also see: http://stackoverflow.com/questions/6458840/on-input-change-event#answer-6458949 – Clint Mar 03 '14 at 15:19