There's a webpage that messes up html code by embedding it within another html code and when I try to replace the entities with their symbol equivalents, it just removes everything.
Here's the code I tried:
var marks = document.getElementsByTagName("body");
for(var i = 0, l = marks.length; i < l; i++)
{
var mark = marks[i];
mark.innerHTML = mark.innerHTML.replace('<', '<');
mark.innerHTML = mark.innerHTML.replace('>', '>');
mark.innerHTML = mark.innerHTML.replace('&', '&');
}
but here's what it does: https://jsfiddle.net/rkb89odm/2/