Is there a method or function that does this, or do I have to check each character of a string. To give an idea on what I'm talking about, for example. I have an HTML TEXT like:
<p><strong>Welcome </strong>to this <em>message, </em><span style="text-decoration: underline;">you may come in peace.</span></p>
I need to convert it into a plain text, resulting into:
Welcome to this message, you may come in peace.
The text will come from a textarea which is a child of a div
with an id = editor-email
.
I also wanted to take the current text, but it won't work.
var textEmail = $('#editor-email').find('textarea').text();
Welcome to this message, you may come in peace.
" html = html.replace(/ – Dmytro Myronenko Apr 22 '21 at 08:12