How to apply live() like feature for JavaScript appended DOM elements

前端 未结 4 924
感动是毒
感动是毒 2021-01-16 22:23

How to apply live() like feature for JavaScript appended DOM elements?

Like a li list inside ul which is added through JavaScr

4条回答
  •  醉话见心
    2021-01-16 23:13

    You can manually attach the event handler whenever you create a new element. Or, you can do it exactly how jQuery is doing it by looking into the jQuery library and extracting the parts you need.

提交回复
热议问题