<textarea id="orig">
<p>
This is Ray and I'm <i>very</i> cool. I sometimes am <b><i>super</i></b> cool!
</p>
<code>
this is bad code!
and lots and lots
</code>
<ul>
<li>more</li>
<li>more</li>
</ul>
</textarea>

<textarea id="new"></textarea>
textarea {
  width: 100%;
  height: 170px;
}

let s = document.querySelector('#orig').value;

// replace all html
s = s.replace(/<.*?>/g, _=> ' '.repeat(_.length) );

document.querySelector('#new').value = s;

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.