I want to apply code to a series of matched elements with a delay between each. I don't understand why the following code doesn't work:
jQuery(".myElement").each(function() {
setTimeout(function() {
jQuery(this).remove();
}, 1000);
});
I know there's been similar questions asked, but the answers haven't worked for me. I understand that this code is simultaneously applying the delays to each matched element, which isn't what I want. But I still can't figure out how to make it work.