JSFiddle - React, Tailwind, and code Playground
HTML
<link href='http://fonts.googleapis.com/css?family=Gentium+Book+Basic' rel='stylesheet' type='text/css'>
<h2 style="text-align:left;" contenteditable="true">
This is the title to bold
</h2>
<br />
<a id="boldIt" href="#">Bold selected text</a>
CSS
h2 {
font-weight: 700;
}
JavaScript
document.execCommand("styleWithCSS", false, true);
$("#boldIt").on("click", function() {
document.execCommand('bold', false, null);
});