Answers for "decode html javascript"

0

Javascript convert html entity to string

const htmlEntities = {
    "&": "&",
    "<": "&lt;",
    ">": "&gt;",
    '"': "&quot;",
    "'": "&apos;"
  };
return str.replace(/([&<>\"'])/g, match => htmlEntities[match]);
}
Posted by: Guest on August-18-2020
0

unescape html js

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
var Title = $('<textarea />').html("Chris' corner").text();
console.log(Title);
</script>
Posted by: Guest on August-31-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language