Jul 29, 2007

escapeHTML

            function escapeHTML (str)
            {
            var div = document.createElement('div');
            var text = document.createTextNode(str);
            div.appendChild(text);
            return div.innerHTML;
            };