The question is published on by Tutorial Guruji team.
I have a label, and i change the text in this label using this code:
let label = document.getElementById("resultLabel") label.innerHTML = stringResult;
stringResult is a string.
It works, but if the string contains “<” the text is truncated at that point: for example if the string is “a<b” only “a” will be shown.
How can I insert a string containing “<” as the text of an HTML label?
How about using
let label = document.getElementById("resultLabel"); label.textContent = stringResult;