diff --git a/entries/trigger.xml b/entries/trigger.xml index c840b058..91e3c26a 100644 --- a/entries/trigger.xml +++ b/entries/trigger.xml @@ -46,6 +46,7 @@ $( "#foo").trigger( "custom", [ "Custom", "Event" ] );

The .trigger() method can be used on jQuery collections that wrap plain JavaScript objects similar to a pub/sub mechanism; any event handlers bound to the object will be called when the event is triggered.

Note: For both plain objects and DOM objects other than window, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault(). If this behavior is not desired, use .triggerHandler() instead.
Note: As with .triggerHandler(), when calling .trigger() with an event name matches the name of a property on the object, prefixed by on (e.g. triggering click on window that has a non null onclick method), jQuery will attempt to invoke that property as a method.
+
Note: When triggering with a plain object that is not array-like but still contains a length property, you should pass the object in an array (e.g. [ { length: 1 } ]).
Clicks to button #2 also trigger a click for button #1.