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.
There is a getWrapperElement on code mirror editor objects which gives you the root DOM element of the code mirror instance:
getWrapperElement
var codemirrorDomElem = editor.getWrapperElement();