JSFiddle - React, Tailwind, and code Playground

HTML

<button id="Bold"><b>B</b></button>
<button id="Italic"><b>I</b></button>
<div id='fake_textarea' contenteditable>
Select some text and click the button to make it bold...
<br>Or write your own text
</div>

CSS

#fake_textarea {
  width: 100%;
  height: 200px;
  border: 1px solid red;
}
button{
  font-weight:bold;
}

JavaScript

$(document).ready(function() {
  $('#Bold').click(function() {
    document.execCommand('bold');
  });
   $('#Italic').click(function() {
    document.execCommand('italic');
  });
});