How does jQuery .live() work?

后端 未结 5 594
渐次进展
渐次进展 2020-12-03 22:25

I was thinking about performance regarding

.click() vs .live(\"click\")

and that left me wondering about how .live does work.

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 22:52

    live binds the click event to the DOM's document element. As browser events bubble up through the DOM tree, the click event is triggered for any matching elements.

    Here's a good article explaining it all.

    http://www.alfajango.com/blog/the-difference-between-jquerys-bind-live-and-delegate/

提交回复
热议问题