How to use 'html to text javascript' in JavaScript

Every line of 'html to text javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
159function html2js(text){
160 var split1 = text.split("\n");
161 text = "var text = \"\";\n";
162 for(var i=0;i
19function text2html(text) {
20 return text.replace(/&amp;/g, '&amp;').replace(//g, '&gt;').replace(/\n/g, '<br />');

Related snippets