JSFiddle - React, Tailwind, and code Playground

by dshilkret

JavaScript

function decodeHtmlEntities(str) {
    var txt = document.createElement("textarea");
    txt.innerHTML = str;
    return txt.value;
}

// Original string with HTML entities
var originalString = "<script type=\\"text/javascript\\" ng-src=\\"https://example.com/script1.js\\" src=\\"https://example.com/script1.js\\"></script>";

// Decode the string
var decodedString = decodeHtmlEntities(originalString);

// Log the decoded string to the console
console.log(decodedString);