В основном мне нужно иметь возможность искать теги "<" и ">" в пределах block and have them set as TEXT rather than HTML, so that I can display all tags and HTML on the page.</p>
<p>At the moment all tags are coming through as actual HTML on the page when I do a string replace using jQuery:</p>
<pre><code>var text = $("#edit").val();
filter = text.replace(/</gi,"<").replace(/>/gi,">");
$("#output").html(filter);
Я не могу изменить html () на text (), потому что любой HTML, ВНЕ, за пределами блока в порядке,Я в основном ищу что-то очень похожее на то, как эта идея тега textbox / code работает на stackoverflow.
Есть ли простой способ сделать это с помощью JavaScript / jQuery?
Спасибо