📜  代码镜像适用于所有文本区域 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:37.347000             🧑  作者: Mango

代码示例1
var textareas = document.querySelectorAll(".textarea-class");
for (var i = 0; i < textareas.length; i++) {
    CodeMirror.fromTextArea(textareas[i], {
        lineWrapping: true,
        mode: "javascript",
        theme: "neat",
        lineNumbers: true
     });
}