Answers for "html text to normal javascript"

1

javascript html string to plain text

myString.replace(/<[^>]*>?/gm, '');
Posted by: Guest on May-04-2021
4

js convert html to text

// To remove all HTML tags use the ".replace(/<[^>]+>/g, '')" method.
let myHTML= "<div><h1>Jimbo.</h1>\n<p>That's what she said</p></div>";
let strippedHtml = myHTML.replace(/<[^>]+>/g, '');
console.log(stripedHtml); // Jimbo. That's what she said
Posted by: Guest on September-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language