I'm trying to use jQuery to remove a div and all of its content when a child div is clicked. To explain this, here is a working [FIDDLE](http://jsfiddle.net/r0taz01L/40/). Basically I need to remove the `pDiv` when the close button is clicked. So I tried this:

```
$('div').on('click', '.closeDiv', function () {
    $(this).prev().remove();
    $(this).remove();
     $(this).parent().remove();
    $('#upload-file').val("");
});

```

However this doesn't seem to delete the `pDiv`.

Please test the FIDDLE above buy adding an image and then click on the Green close button and then try to add another image and you will see that the previous `pDiv` hasn't been removed.

Could someone please advice on this issue?

Thanks in advance