亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

How to change the text color in a string in javascript
巴扎黑
巴扎黑 2017-05-19 10:32:03
0
3
989
  1. '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 '

  2. 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="請輸入內(nèi)容" v-model="inputValue"></textarea>
<iframe src="about:blank" id="bbb" contentEditable="true" width="100%" height="100%"></iframe>

Currently using this method to solve

巴扎黑
巴扎黑

reply all(3)
PHPzhong
測試文字<span style="color:red">測試文字</span>
為情所困

The following replaces the first and third coughs, adding red.

var str = '測試文字測試文字測試文咳嗽字測試文字測試文字咳嗽測試文字測試文字測試文字測試文咳嗽字測試文字';

var result = str.replace(/(咳嗽)([^咳]+[^咳]+)/, '<span sytle="color:red"></span><span sytle="color:red"></span>');

console.log(result);
大家講道理

If you know the location, just subscript and add color. You can also use regular filtering

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template