I'd like to display some well formatted HTML on my page. That HTML will be compiled in the script. To show that HTML I am using < pre ><code> HTML CONTENT </code>< /pre >
The problem is I have no Idea how to add line breaks and other formatting to the variable that is compiling the HTML.
MY SCRIPT:
var CodeShow = '<div id="builder" class="' + LoginClasses + '">
<form id="LoginForm" class="formContainer' + FormClasses + '">
</form></div>';
$('#CodeShow').text(CodeShow);
Expected HTML Result:
<code>
<div id="builder" class="classA">
<form id="LoginForm" class="formContainer classB"></form>
</div>
</code>
This is a sample HTML however the real HTML has number of lines.
white-space: pre-lineon the<code>but didn't work :( Also, please reply as an answer so that I am mark it. Thanks