What is the difference between jquery on with / without selector parameter and jquery delegate?

前端 未结 4 1766
孤街浪徒
孤街浪徒 2021-01-18 06:38

I am using jquery 1.10. I want to know what the difference is between these three functions.

Which function is better and why?

What is the purpose of the del

4条回答
  •  不知归路
    2021-01-18 07:16

    .delegate()

    Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.

    .delegate() has been superseded by the .on() method

提交回复
热议问题