HTML encodes an HTML string ensuring that HTML is displayed as text.

Creates a div element assigns the text and then reads back the encoded HTML text.