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