html_entity_decode javascript code example
Example 1: html_entity_decode
html_entity_decode
$temp = "<font class='red font-price'> 30 </font>";
echo html_entity_decode($temp);
Example 2: Javascript convert html entity to string
const htmlEntities = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'"
};
return str.replace(/([&<>\"'])/g, match => htmlEntities[match]);
}