Change textarea with jquery and refresh editor

My page has both the CodeMirror editor, and a simple input form that updates the html with jquery. My jquery only updates the previewed html though. How can I change the textarea and refresh codemirror’s editor once the form is submitted?

$(’#submit’).click(function(e) {
var newstuff = $(’#formID’).val();