I'm creating a simple typing tool (I have to use IE11). Note that this does not happen in Firefox, where everything works just fine.
The execCommand forecolor is giving me a undesired result:
I type some text with black, then let's say I want to type inside one of the black words but with a different color. If I place the caret in the word and click the new color I want to use (which executes document.execCommand('foreColor', false, currentForeColor);) the whole word will become of the newly selected color. If I first select the color and then place the caret in the middle of the word, the color will remain black (this also happens on Firefox).
There are a few screenshot to give an idea.
Type some black text:
Click in the middle of the word and select a color:
The actual desired result:
What I would like to achieve is that once you chose a color it will type with that color wherever you place the caret and without affecting the present words.