basically I need to be able to search for tags "<" and ">" within a <code> block and have them set as TEXT rather than HTML, so that I can display all tags and HTML on the page.
At the moment all tags are coming through as actual HTML on the page when I do a string replace using jQuery:
var text = $("#edit").val();
filter = text.replace(/</gi,"<").replace(/>/gi,">");
$("#output").html(filter);
I cant change html() to text() because any HTML, OUTSIDE the block is fine. I'm basically looking for something very similar as to how this textbox / code tag idea works on stackoverflow.
Is there an easy way to do this using JavaScript / jQuery?
Thanks