I am trying to call a function everytime a .element
is created or deleted, or when the content of a .element
changed. I can use livequery for the creation event; is there a way to register "edit" or "delete" callbacks?
Thank you in advance!
livequery
can handle the deletion of the element. Pass a second function argument. It will run when an element that matches the selector is removed.
With respect to edit, I suppose it will depend on the type of edit. If you remove a class such that it no longer matches the selector you gave to livequery
, I think the second function argument will be triggered in that case as well.