Struggling to implement event delegation for a dynamically added or removed class? I need to create an event for elements that are clicked, but without a specific class. Here's the code I have so far, but it doesn't seem to be working. Could it be a syntax error? If yes, how can I correct it?
$('.gallery-cell a img').off('click').on('click', ':not(.g-clicked)', function() {
// more code here
});