📜  javascript代码示例中的委托

📅  最后修改于: 2022-03-11 15:03:19.932000             🧑  作者: Mango

代码示例1
Definition and Usage
The delegate() method was deprecated in version 3.0. Use the on() method instead.

The delegate() method attaches one or more event handlers for specified elements that are children of selected elements, and specifies a function to run when the events occur.

Event handlers attached using the delegate() method will work for both current and FUTURE elements (like a new element created by a script).

Syntax
$(selector).delegate(childSelector,event,data,function)