Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Put html code in textarea

I have a div whose innerHTML i want to put it in textarea, the problem is that the div content is with html tags and when i place that in textarea it does not show the executed html code but it shows text with html tags. I want the executed html code in the textarea, how can I achieve this? I have searched all through the net but not able to find it. Any kind of help will be highly appreciated

Thank you

like image 932
Eric Ilavia Avatar asked Feb 21 '23 13:02

Eric Ilavia


1 Answers

Instead of textarea you can use div with contenteditable attribute:

<div contenteditable="true">
  This text can be edited by the user.
</div>
like image 67
Engineer Avatar answered Mar 05 '23 04:03

Engineer