I have two places, the first is <textarea></textarea>
and is used to write code.
The second is <pre></pre>
used to display the code.
The problem is when writing code in the text area to display it in the second place, the code is applied and displayed as an HTML element, not just code as I want.
Incorrect behavior:
Correct behavior (what I want):
Code:
<textarea id="inputCode" cols="50" rows="10"></textarea><br/>
<pre id="outputCode"></pre>
source
to share