Following code gets correctly formatted in HTML using Pre tag. The break tags get rendered correctly showing line breaks
<pre id="code"> package a;<br>import a.b;<br>import d.c;<br>public class Test{<br>}
</pre>
Get the following output -
package a;import a.b;
import d.c;
public class Test{
}
However if I load the same text using javascript
code.innerText = currentQuestion.code;
The break tag do not get rendered correctly and are shown as it is -
package a;<br>import a.b;<br>import d.c;<br>public class Test{<br>}
Can someone please help me here..thanks