Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mzechmeister/a55ea7313d31ef4df68a3d35164f1d40 to your computer and use it in GitHub Desktop.
Save mzechmeister/a55ea7313d31ef4df68a3d35164f1d40 to your computer and use it in GitHub Desktop.
delete_behaviour_contentEditable_false
<!DOCTYPE html>
<html>
<style>
span {color: gold}
span[contenteditable=false] {color: red}
</style>
<body>
Try to delete the "!":
<div contenteditable>
Here is a <span contenteditable=false>contentEditable False</span>! Ok.
</div>
<div contenteditable>
Here is a <span><span contenteditable=false>contentEditable False</span>!</span> Never works.
</div>
<div contenteditable>
Here is a <span>!<span contenteditable=false>contentEditable False</span></span>. Never works.
</div>
<div contenteditable>
Here is a <span>!<span contenteditable=false>contentEditable False</span> embedded</span>. Ok.
</div>
<div contenteditable>
Here is a <span style="color:green">span before</span><span>!<span contenteditable=false>contentEditable False</span></span>. Only if the caret is green.
</div>
<div contenteditable>
Here is a <span><span contenteditable=false>contentEditable False</span>!</span><span style="color:green">span before</span>. Never.
</div>
</body>
</html>
@mzechmeister
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment