Demo: Renaming the trigger from an input command
Item level events handlers are bound with the menu's
options object as jQuery event data, so e.data.$trigger is the element that opened
the menu. Inside the handler this is the <input> itself, exactly like any other
jQuery event handler.
Both buttons below share a single menu definition. Left-click one, type a new label and click somewhere else so the input loses focus. The button you clicked is renamed, the other one is not.