Answers for "convert text string to html"

6

html string to html

/**
 * Convert a template string into HTML DOM nodes
 * @param  {String} str The template string
 * @return {Node}       The template HTML
 */
var stringToHTML = function (str) {
	var parser = new DOMParser();
	var doc = parser.parseFromString(str, 'text/html');
	return doc.body;
};
Posted by: Guest on May-28-2020
0

convert html to text

jQuery(html).text();
Posted by: Guest on August-24-2021

Code answers related to "convert text string to html"

Code answers related to "Assembly"

Browse Popular Code Answers by Language