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

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -

Qt4: how to send QString inside a struct via QSharedMemory -