JSFiddle - React, Tailwind, and code Playground
HTML
<p contenteditable="true">Hello world</p>
<button id="color">Change Color</button>
JavaScript
$('#color').click(function(){
document.execCommand('ForeColor', false, 'red');
});
<p contenteditable="true">Hello world</p>
<button id="color">Change Color</button>
$('#color').click(function(){
document.execCommand('ForeColor', false, 'red');
});