Input List Selection Changed Event
The input
event should work for what you need. As I understand, you can't use a datalist directly, but it is connected to an input by the list
attribute. This event binding would go on that input:
document.getElementById('browsers-input').addEventListener('input', function (event) {
if (event.inputType == 'insertReplacementText')
console.log('autocomplete option selected');
});
http://jsfiddle.net/vccfv/
To get the same effect of "Explosion Pills" solution using JQuery style:
$("#browsers-input").on("input", MySuperFunction);
Usin jQuery
you could use .change
http://jquery.com/
$('datalist#browsers').change(MySuperFunction);
or
$('datalist#browsers').change(function(){
// stuff
});