The best way around this problem is to use the
The way to use this function is like a regular PHP function:
PHP function structure...
str = escape(document.getElementById('somediv').innerHTML);
This way you can use any special HTML character and stays the way it’s suppose to.
For more info you can go here.
Hope this help any one…