Parent element not being removed when removing image
See original GitHub issueIn callbacks
, onImageUpload
I create a block <picture><img></picture>
.
Also in the callbacks
, I’ve added:
onMediaDelete: function(target) {
target.closest('picture').remove();
}
But the parent <picture>
is not removed. I console-logged the properties of target
and both parentElement
and parentNode
are null
.
How can I delete the entire <picture><img></picture>
block onMediaDelete
?
Thank you in advance.
Issue Analytics
- State:
- Created a year ago
- Comments:9
Top Results From Across the Web
Delete parent element and all children if img src broken
I'm doing an Ajax query that pulls back a JSON array filled with ~50 urls to images. I then use a forEach on...
Read more >jQuery: Remove parent element containing empty span | WP-Mix
This technique is useful in any scenario where you want to remove not just an empty span or div, but also the parent...
Read more >How to remove a parent div in JavaScript if all the ids ... - Quora
The easiest way would be to get the parent element and simply use the remove() method on it: document.getElementById("element-id").remove();. or the ...
Read more >.contents() | jQuery API Documentation
Given a jQuery object that represents a set of DOM elements, ... Stop the currently-running animation, remove all queued animations, ... :image Selector....
Read more >How to delete data from child and also its image ... - MongoDB
I used MongoDB middleware remove to perform cascade dele… ... deleting it but if I delete the parent the child is deleted but...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Then use
$(".note-editable")
instead.Appreciate it @1der1.