我想实现一个python版本的网络regexbuddy,我遇到了一个问题,如何在文本区域中以不同颜色突出显示匹配值(在黄色和蓝色之间切换),有一个演示我想要什么http://regexpal.com ,但我是js新手,我不明白他的代码含义。 任何建议表示赞赏
最佳答案
为了节省时间,您应该考虑使用现有的库来满足此要求。
引自here :
As textarea elements can’t render HTML, this plugin allows you to highlight text inside textarea elements.
演示:Codepen
用法:
$context.highlightTextarea(options);
关于javascript - 如何突出显示textarea html代码的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3803607/