I would like to know if possible to be able to replace any html character that are inside my pre tag's <pre> replace < with &lt; and this > with &gt; </pre> so it does not affect my pre tag's

$('button[id="instant_preview"]').on('click', function() {
    var code = $('#editable').text();
    $('#preview').html(code);
        replace('<',"&lt;");
        replace('>',"&gt;");
});

So, have you tried it? Did it work? If not, let us know. Please test these snippits before posting here. If it works, then you are wasting a lot of time. If not, then someone can help you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.