TIL: The correct way of adding text to an element
ute-visor project relies on updating the page based on passed data through the socket, I’m having to finally learn it.
Today I learned that there’s a more correct way of adding text to a found element rather than just setting the
innerHTML to a value. Evidently doing things that way leads yourself to potential security risks.
So to avoid those potential issues, the correct way of doing it is as follows:
This will create a new text node and add it to the selected element.