Skip to content

Instantly share code, notes, and snippets.

@ocharles
Created July 4, 2009 13:46
Show Gist options
  • Select an option

  • Save ocharles/140583 to your computer and use it in GitHub Desktop.

Select an option

Save ocharles/140583 to your computer and use it in GitHub Desktop.
var $input = $('<input>').appendTo(...);
var comp = new jQuery.myautocomplete($input, {
onSelection: callback
});
function callback()
{
this; // Would point to "comp" - the autocompleter above
this.id() // Return the selected Id
this.value() // Return the selected value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment