JSFiddle - React, Tailwind, and code Playground
by AndyE
HTML
<div contenteditable="true">Select some of this text</div><button id="bold">Toggle bold</button>
JavaScript
function makeBold() {
document.execCommand("bold", false, null);
}
$("bold").onclick = makeBold;