So I have a system were the user of the site can create div's and all these div's get different class names, with all these div's there will also be created a delete button with the same class. How do you remove the button and the div with the same class on click on the button.
I figure'd it would be something like this:
$("div.Test").remove();
only than with a this tag.
Within the click event of your button:
var thisClass = $(this).attr("class");
$('div.' + thisClass).remove();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With