REACT JS : im trying to make simple editor for my project , which can make text bold , italic and underline
im using contentEditable
<div className="inputBox" contentEditable>some text here to play with</div>
and im using a button just above it to make text bold
<div className="button' onClick={this.buttonCLick.bind(this)}>BOLD</div>
which calls this onclick
buttonCLick(){
let isWorking = document.execCommand('bold',false,'');
console.log('isWorking:', isWorking);
}
but the "isWorking
" return false
every time and nothing happns to selected text .