jQuery htmlspecialchars equivalent to encode text as HTML Posted on 2014-08-18 [Monday] by Jay Jay Found this which said: $('<div/>').text('This is fun & stuff').html();