JSFiddle - React, Tailwind, and code Playground

JavaScript

var encodedString = $('<div />').text('bobs').html();
console.log(encodedString);