Javascript and html special characters & " < >.

str = "abc&quot;def&amp;jkl&lt;mnp&gt;"
str = str.replace(/&quot;/g,'"');
str = str.replace(/&amp;/g,"&");
str = str.replace(/&lt;/g,"<");
str =  str.replace(/&gt;/g,">");
alert (str);

Leave a Reply

Статьи