Users Pricing

forum

home / developersection / forums / convert special characters to html in javascript

Convert special characters to HTML in Javascript

Anonymous User 3264 03 Sep 2013

Does any one know how to convert special characters to HTML in Javascript?

Example:

'&' (ampersand) becomes '&amp' 
'"' (double quote) becomes '&quot' when ENT_NOQUOTES is not set.
''' (single quote) becomes '&#039' only when ENT_QUOTES is set.
'<' (less than) becomes '&lt'
'>' (greater than) becomes '&gt'

Thanks in advance.


I am a content writter !


1 Answers