Using events with dynamically created objets

Using events with dynamically created objets

Hi my name is Murilo,

I am new at jQuery and i hope i am not asking a stupid question.

I have a button, when i click the button a new div appear already with a event.
I am using the event 'on' to bind the event 'click' with the new div and it works fine.
However, when i try to use the 'drop' event of jQuery UI it doesn't work.
I think i am using the wrong event name.


I create divs with the class 'myClass'. When i get the 'click' event, it works. When i get try the 'drop' event, it does not work.

$('body').on('click', '.myClass', function () {
      console.log('click');
});

$('body').on('drop', '.myClass', function () {
      console.log('drop');
});

Thanks in advance.