There is the following block:

<div contenteditable="true"> Здесь html код </div> 

I can edit this block right on the page, but if it contains HTML stylized text, then when copying this text, the corresponding HTML code is also copied with it. Question: how to clear the buffer when copying from HTML code and leave ONLY text? Thanks in advance for the answer to such a non-standard question.

  • Why do you need a layer with contenteditable="true" and where do you copy the fragment? - Konstantin Basharkevich
  • I need a layer for a simple HTML editor, and I copy the text to other layers. - John Kindle
  • If you are about a problem when you copy and paste into the same div, then this is a problem contenteditable - this is not a reliable way to make an editor. Usually there is a hidden text field that implicitly intercepts the input and visualizes it in the editor element. - Aleksander K.
  • Alexander, it is about this problem that is being discussed. And it is possible more in detail about you the stated method of implementation of analog contenteditable? - John Kindle
  • I asked a question on this topic, you can learn something from there: ru.stackoverflow.com/questions/435684 - Aleksander K.

0