createTextNode

Creates a new Text node. This method can be used to escape HTML characters.

MDN Reference