How to set bold text in UI Plugin?

Hey! I hope that someone can help me

I’m trying to make a Plugin that call components from my library and edit his text property

But I can’t get the font weight to change to bold. I was wondering how to make a RichText editor where the changes are instantly visible to the user

There are a plenty of plugins that make this, but the function document.execCommand is not working for me =(

I was trying this:

Texto da bolha Bold

Thanks!

<div>
<textarea class="textarea" rows="2" id="idTextoBolha">Texto da bolha</textarea>
<button id="bold_button">Bold</button>
<script>
  document.getElementById('bold_button').onclick = () => {
        document.execCommand("bold",true,null);
  }  
</script>
</div>

Text area has no formatting capabilities. You need to use “div contenteditable” for that