Quote:
the below code work to replace the < but when i try including >,",' and & in the function it will stop work how can i make it work please someone should help me out.
I think the key is to start with replacing & first and then the other chars in any order.
var str2 = str.replace(/&/g,"&");
var str2 = str2.replace(/</g,"<");
var str2 = str2.replace(/>/g,">");
...
Because all encoded chars starts with '&', you need to replace it first.