Is there a way to implement a toggle function for an element that is generated dynamically? I am having trouble with my current code:
Javascript
$("body").on('click', ".buttonA", function(){
function() {
// perform some tasks
},
function() {
// undo the tasks
}
});