` element could have been used in the same fashion.
Every creator may accept different parameters and handle initialization differently. For instance, the classic editor will replace a given element with an editor, while the inline editor will use the given element to initialize the editor on it. See each editor's documentation to learn the details.
The interface of the editor class isn't enforced either. Since different implementations of editors may vary heavily in terms of functionality, the editor class implementers have full freedom regarding the API. Therefore, the examples in this guide may not work with some editor classes.
## Interacting with the editor
Once the editor is created, it is possible to interact with it through its API. The `editor` variable, from the above examples, should enable that.
### Setting the editor data
To replace the editor contents with new data, just use the `setData` method:
```js
editor.setData( '
Some text.
' );
```
### Getting the editor data
If the editor contents need to be retrieved for any reason, like for the scope of sending it to the server through an Ajax call, simply use the `getData` method:
```js
const data = editor.getData();
```
### Destroying the editor
In modern applications, it is common to create and remove elements from the page interactively through JavaScript. CKEditor instances should be destroyed in such cases by using the `destroy()` method:
```js
editor.destroy()
.catch( error => {
console.log( error );
} );
```
Once destroyed, resources used by the editor instance are released and the original element used to create the editor is automatically displayed and updated to reflect the final editor data.
## What’s more?
CKEditor offers a rich API to interact with editors. Check out the {@link TODO API documentation} for more.