I need to add a click handler to a dynamic added link. I have read that the click method from JQuery does not work for dynamically created elements (and actually I could not get it to work).
I have the following code:
$(this).find(ops.editbuttonselector).click(function(e) {
As the .live method is now deprecated, I would need to use .on for this. According to this thread and my undersntanding of jquery (which is limited), I should do:
selector = $(this).find(ops.editbuttonselector)
$(document).on('click', selector, function(e) {
But this also did not work and actually what was working before (existing elements) stopped working as well.
Can someone please point me to the right syntax.
thanks in advance