The issue I'm facing involves a contenteditable div
. Inside, there is a span for a 'fraction', following guidance from this source. Below is my current code snippet:
<span style="display:inline-block; vertical-align:middle;" contenteditable="false">
<span style="display:block; min-width: 20px;border-bottom:1px solid black; text-align: center; outline: none;" contenteditable>6</span>
<span style="display:block; min-width: 20px;text-align: center;outline: none;" contenteditable>7</span>
</span>
I am encountering an issue when attempting to delete the 'fraction' span. Instead of removing the entire span with its contents, only the inner contenteditable spans are deleted. I want all three elements to be removed when deleting the outer span (as this program deals with Math). How can I achieve this?
UPDATE: Alternatively, if it's not possible to delete the outer span and its children simultaneously, is there a way to select the entire span element along with its contents by pressing the delete key next to the big fraction span?