开发者

How to replace a Character in text By jquery

How to replace a charcter within a text For instance

 <script>alert("Hi i am nishant");</script>开发者_C百科

here i want to replace < and > by ASCII code so how i will replace it.


var text = text.replace(/</g, "&lt;").replace(/>/g, "&gt;");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜