实现就是控制台的内容“abc”,但是后台返回的是“ABC”,这个时候在前台遍历,需要将后台返回的在控制台标红。

当然控制台可以是 abc Abc等大小写混合,以下代码都可替换。

var flagnew = flag.replace(/[^a-z\d]/ig,"");

if(flagnew!=null){

var newstr = query.replace(new RegExp(flagnew,"ig"), "<font id='redmessage' color='red'>$&</font>");

$("#textarea").html(newstr.replace(newstr, "<font style='font-size: 14px;'>"+newstr+"</font>"));

}

相关文章:

  • 2022-12-23
  • 2022-01-21
  • 2021-05-19
  • 2021-12-21
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
猜你喜欢
  • 2021-05-24
  • 2022-12-23
  • 2021-10-03
  • 2021-10-07
  • 2018-08-07
  • 2022-12-23
相关资源
相似解决方案