I want to be able to return the value of the CKEditor textarea, and also write my text inside it.
I used CKEditor 5 CDN. First this my code for the textarea it works
You need to get or save the editor created and then use the getData() function.
You can add a .then() on creation to save your editor.
var myEditor;
ClassicEditor
.create( document.querySelector( '#editor' ) )
.then( editor => {
console.log( 'Editor was initialized', editor );
myEditor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
and then get data using
myEditor.getData();