Proper use of .on method in Jquery

前端 未结 6 1772
慢半拍i
慢半拍i 2020-12-11 17:13

I really liked the .live method as it was straightforward and essentially not much different than your standard event handler.

Alas, it was deprecated and I\'m left

6条回答
  •  青春惊慌失措
    2020-12-11 17:51

    The context when using .live was document, therefore the selector for .on should be document

    $(document).on("click","#who_me",function(){...});
    

提交回复
热议问题