javascript - Remove image on image click -


demo here

i want remove image , not whole div on clicking cross button. took reference here.

    $('.remove-img').click(function(e) {         $( ).parent().remove();     }); 

traverse parent() .find() image excluding current image. can use remove()

use

$('.remove-img').click(function (e) {     $(this).parent().find('img').not(this).remove();      //if want remove images     //$(this).parent().find('img').remove(); }); 

demo


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -