Reputation: 367
I have some rows where the user can click and then I run a jQuery function, everything working fine.
As some rows have extra options I decided to load those extra options in a popup window using sweet alert and they should do the same (when the row inside the sweet alert is clicked run same function)
The problem is that the rows inside the sweet alert popup are not calling any function on click. Why can be this?
Can I use sweet alert for this or should I look for other plugin?
This is how I'm calling the jQuery function
$('.maincontent').on('click', '.betHandle', function () {
add(this);
});
Upvotes: 1
Views: 452
Reputation: 3288
I think there is one of two possible reasons it isn't working.
.betHandle
may not be under .maincontent
in the DOM tree.maincontent
is added to the DOMIn either case, adding the listener to the body will work:
$('body').on('click', '.betHandle', function () {
add(this);
});
Upvotes: 1