Skip to content

Commit 3bae269

Browse files
jlbookerJake Harding
authored andcommitted
Add example of capturing custom events to docs
1 parent 10c6cef commit 3bae269

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/jquery_typeahead.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,17 @@ a typeahead.
220220
handler will be invoked with 3 arguments: the jQuery event object, the current
221221
query, and the name of the dataset the async request belongs to.
222222

223+
Example usage:
224+
225+
```
226+
$('.typeahead').bind('typeahead:select', function(ev, suggestion) {
227+
console.log('Selection: ' + suggestion);
228+
});
229+
```
230+
231+
**NOTE**: Every event does not supply the same arguments. See the event
232+
descriptions above for details on each event's argument list.
233+
223234
<!-- section links -->
224235

225236
[`change` event]: https://developer.mozilla.org/en-US/docs/Web/Events/change

0 commit comments

Comments
 (0)