I want to do a function like Draggable
from interact.js. This function adds events to multiple elements, depending of the class name, ID or tag name I choose. When a new element is added on body, it gets an event from this function from interact.js (that maybe like click
,mousedown
,mousemove
,mouseup
). I don't know if my way is good to do:
- add a
onchange
event to the body to check if a element was added (by the innerHTML)
Is there a better way to do this?