I\'m using jQueryUI autocomplete, and I have a function mapped to the select event, e.g.:
$(\"#someId\").autocomplete({ source: someData, select: fun
You can do it the way the jQuery team does it in their unit tests - see this answer