Does jQuery.on() work for elements that are added after the event handler is created?

前端 未结 2 1654
走了就别回头了
走了就别回头了 2020-11-22 01:59

I was under the impression all this time that .on() worked like .live() with regards to dynamically created elements (e.g. I use $(\'.foo\').

2条回答
  •  长发绾君心
    2020-11-22 02:22

    I think you face similar situation that i faced. this is quite a good solution for binding events withe elements generated later.

    Binding Jquery Events On Elements Generated Through Other Events

提交回复
热议问题