jQuery event delegation

You can’t set a click handler on an element that doesn’t exist. What you should do is use .on to bind a element further up the tree. Something like:

$("#someparentelement").on("click", "#yes", function() {
    // your code
});

Leave a Comment