deleteFromDocument deletes more than just text #34943
Labels
Content:WebAPI
Web API docs
help wanted
If you know something about this topic, we would love your help!
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/Selection/deleteFromDocument
What specific section or headline is this issue about?
First paragraph
What information was incorrect, unhelpful, or incomplete?
It says the method deletes the text in the selection This implies (to me anyway) that it deleted the text nodes or perhaps empties them out. In my tests it actually deletes everything in the selection. I have a div full of text, embedded divs., images etc. If I select the whole thing and call deleteFromDocument(), the embedded divs imgs etc are completely removed. (That's good - that's what was hoping).
What did you expect to see?
Clarity on what is actually removed.
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/web/api/selection/deletefromdocument
The text was updated successfully, but these errors were encountered: