Question: I've added a CKEditor instance programmatically to my page in the code-behind of my ASP.NET page:

VB.NET:

```
itemEditor = New CkEditor
cell.Controls.Add(itemEditor)

```

... which works fine. I can get the HTML on the postback and do stuff with it.

However, I also want to do some client-side stuff with it, specifically take a selected item out of another control, and insert it into the text by handling the `onchange` event.

So, how can I get the name of the editor instance in the JavaScript, so that I can do stuff like:

```
function GetCkText()
{
    var htmlFromEditor = CKEDITOR.instances['editorName'].getData();
    // do stuff with htmlFromEditor
}

```

Answer: 
If you only have a single instance and you do not know the name of it.

```
CKEDITOR.instances[Object.keys(CKEDITOR.instances)[0]].getData()

```
If you need the instance from a **plugin**, at least in version 4+ you can do this.

```
CKEDITOR.currentInstance

```

Here I am wanting to know the name of the textarea I applied ckeditor on.

```
CKEDITOR.currentInstance.name

```