Answers for "convert html to javascript string"

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
1

convert element to html string

html_entity_decode

$temp = "<font class='red font-price'> 30 </font>";
echo html_entity_decode($temp);
Posted by: Guest on November-09-2020

Code answers related to "convert html to javascript string"

Browse Popular Code Answers by Language