JSFiddle - React, Tailwind, and code Playground

by rwone

HTML

<div id="encode_me"><html>test</html></div>

JavaScript

my_value = $("#encode_me");

my_value.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');