Users Pricing

forum

Home Forums Convert special characters to HTML in Javascript – MindStick

Convert special characters to HTML in Javascript

Anonymous User 3347 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.


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md