0

I'm trying to create a tooltip that works for dynamically created elements. Right now, the tooltip that I make only works for elements processed when the page loads. Here it is:

https://jsfiddle.net/ttkz4krg/

I tried to follow the link below to get my function to work on dynamically created elements:

Jquery events do not work on dynamically appended elements

And so I tried doing this with the

$(document).on('event', 'element', function () {
});

method. Here it is: https://jsfiddle.net/thwtLh7p/

But I can't manage to get it to work. Can anyone help me out here?

Community
  • 1
  • 1
John
  • 326
  • 4
  • 21

1 Answers1

0

Try to start from body tag not document element

$('body').on('event', 'element', function () {

});
mic4ael
  • 7,974
  • 3
  • 29
  • 42