Put the html code in textarea

I have a div whose innerHTML I want to put it in textarea, the problem is that the content of the div contains html tags, and when I put this in textarea it does not display html executable code, but it shows text with html tags. I want the html executable in a text box, how can I achieve this? I searched the entire network, but could not find it. Any help would be greatly appreciated

thanks

+4
source share
1 answer

Instead of textarea you can use a div with the contenteditable attribute:

 <div contenteditable="true"> This text can be edited by the user. </div> 
+8
source

Source: https://habr.com/ru/post/1411974/


All Articles