# Set value of editor I did not create

**URL:** https://discuss.codemirror.net/t/set-value-of-editor-i-did-not-create/7694
**Category:** Uncategorized
**Created:** [January 12, 2024, 10:36pm UTC](https://discuss.codemirror.net/t/set-value-of-editor-i-did-not-create/7694 "2024-01-12T22:36:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mladair](https://discuss.codemirror.net/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@mladair](https://discuss.codemirror.net/u/mladair)
#### Post date: [January 12, 2024, 10:36pm UTC](https://discuss.codemirror.net/t/set-value-of-editor-i-did-not-create/7694/1 "2024-01-12T22:36:46Z")

</div>

We run a web application that makes used of the CodeMirror editor. In additional, they application allows for the creation of plugins to extent functionality. One plugin we make use of sets the value of an editor when a select list is changed. The problem is that this plugin actually disables the CodeMirror editor and just re-displays the `<textarea>`. I can disable this with no problems, so that the CodeMirror editor stays active. I cannot figure out how to get the editor, through.

- `$('.CodeMirror', $(subform));` returns a valid element
- `$('.CodeMirror', $(subform)).CodeMirror.setValue('VALUE')` throws an error.
- `$('.CodeMirror', $(subform)).CodeMirror` is undefined

Any advice how to get the editor and set it’s value would be greatly appreciated.  
-Matt
