JSFiddle - React, Tailwind, and code Playground

by Qwerty_Wasd

HTML

<div id="text">Qwerty Wasd</div>

JavaScript

let str = text.textContent;
text.textContent = str.replace(/\w/gim, `*`);
console.log(str);