'Test text test text test text cough
word test text test text cough
test text test text test text test text cough
word test text '
The above text test is used to know the position of the first and third cough text and how to change the color of these two words.
<textarea class="editor-input" placeholder="请输入内容" v-model="inputValue"></textarea>
<iframe src="about:blank" id="bbb" contentEditable="true" width="100%" height="100%"></iframe>
Currently using this method to solve
The following replaces the first and third coughs, adding red.
If you know the location, just subscript and add color. You can also use regular filtering