An ordinary event is a direct event registration of an element, which then triggers
The event binding is to register the event on the element
The difference is that ordinary events can not be repeated to add multiple events, and if added will overwrite, only one event will be triggered (the last registered)
Event binding is the ability to repeatedly bind multiple events, and all can trigger
And in jquery It's a bit different, and jquery itself allows you to add multiple trigger functions through ordinary events
function Foo1 () { alert (' Trigger click 1 '); } function Foo2 () { alert (' Trigger click 2 '); } Will trigger two function pop-up trigger click 1 Trigger Click 2 $ (". AcK1"). On (' click ', foo1); $ (". AcK1"). On (' click ', Foo2); $ (". Ack2"). Click (foo1); $ (". Ack2"). Click (foo2); Will trigger two function pop-up trigger click 1 Trigger Click 2
Event binding in jquery refers to event firings on dynamically created element bindings, not just multiple events for an element
Note the dynamic binding of events to an element, which is generally required to be bound by the parent class element, before the child class (the element just added) can be triggered
$ (document). On (' click ', '. AcK1 ', foo1); $ (". AcK1"). Click (function () { var ele=$ (this). Clone (); $ (this). After (Ele); Post-cloned elements can still trigger the Foo1 event function }); $ (". Ack2"). Click (foo2); $ (". Ack2"). Click (function () { var ele=$ (this). Clone (); $ (this). After (Ele); Unable to trigger Foo2 event function });
Event bindings and common events in JS and jquery