Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript htmlentities

var sanitizeHTML = function (str) {
	var temp = document.createElement('div');
	temp.textContent = str;
	return temp.innerHTML;
};
Source by css-tricks.com #
 
PREVIOUS NEXT
Tagged: #javascript #htmlentities
ADD COMMENT
Topic
Name
4+1 =