How to hide textarea in HTML tags?

Tell me how to make the switch between editing text with tags and without. I know it works with a div(contenteditable='true'), but I have a function which adds the selected text tags, when changing to a div, it doesn't work
April 4th 20 at 12:56
2 answers
April 4th 20 at 12:58
I don't understand the question. Ask it clearly.
April 4th 20 at 13:00
Why? After all, there are text editors such as TinyMCE or CKEditor. But if briefly, then clicking on the desired unit/link is hanging class and initiation of launch editor for the text block.

Find more questions by tags JavaScriptHTML