how do you do html encode using javascript?
JavascriptHtml EncodeJavascript Problem Overview
> Possible Duplicate:
> JavaScript/jQuery HTML Encoding
I have html tags need to be encoded.
<b>test</b>
I need to encode it to :
<b>test</b>
I am using escape, but it doesn't work.
document.write(escape("<b>test</b>"));
the result I got is
%3Cb%3Etest%3C/b%3E
this is not what I expected. is there another way to do html encode using javascript?