Skip to content

Instantly share code, notes, and snippets.

@hattmarris
Created August 7, 2015 20:46
Show Gist options
  • Save hattmarris/9efb7761cfdd85c827c7 to your computer and use it in GitHub Desktop.
Save hattmarris/9efb7761cfdd85c827c7 to your computer and use it in GitHub Desktop.
JQuery with Native JS
// Assuming we have a jQuery ui autcomplete loaded...
// jQuery listener
$(domain).on('autocompleteclose', callback);
// Native listeners functionally equivalent to 'autocompleteclose' listener
domain.addEventListener('blur', callback);
domain.addEventListener('focusout', callback);
var ul = document.querySelector('.ui-autocomplete');
ul.addEventListener('click', callback);
// Arbitrary callback
function callback(e) {
console.log(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment