Get CodeMirror instance

后端 未结 6 782
礼貌的吻别
礼貌的吻别 2020-12-23 17:14

I want to get an instance of CodeMirror (it is binded to a textarea \'#code\'). From an onclick-event I want to add a value to the current value of the CodeMirror instance.

6条回答
  •  [愿得一人]
    2020-12-23 17:52

    There is a getWrapperElement on code mirror editor objects which gives you the root DOM element of the code mirror instance:

    var codemirrorDomElem = editor.getWrapperElement();
    

提交回复
热议问题