This link1 - work
<div class="test">test</div>
<div class="test2"></div>
$('.test2').click(function(){
$('.test2').remove();
This link2 - dont work
<div class="test">test</div>
$('.test').click(function(){
$('body').prepend('<div class="test2"></div>');
});
$('.test2').click(function(){
$('.test2').remove();
});
why ?
try:
$(document).on('click','.test2',function(){
$('.test2').remove();
});
fiddle
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