how to take a value from Codemirror TextArea

Hi everybody.

I have two textarea boxes, I need to compare two texts from these boxes. 1 textarea - codemirror , 2 default textarea.

When I change the value of textarea codemirror, the old value that I set in html remains in it and not updated. Can anyone tell me how to fix it?

Show my code -

If you created the editor with fromTextArea, calling save() on it will copy its current value back into the textarea. Or directly call getValue to get its contents.