# States

## Summary

### Element states

| Name                                                      | Type     | Summary                                                                                                                                                                                                                                                 |
| --------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [html content](#html-content)                             | `text`   | Current editor contents as HTML.                                                                                                                                                                                                                        |
| [text content](#text-content)                             | `text`   | Current editor contents as plain text.                                                                                                                                                                                                                  |
| [selected html](#selected-html)                           | `text`   | Currently selected contents as HTML. For this to work, element field 'Enable text selection trigger' needs to be enabled.                                                                                                                               |
| [selected text](#selected-text)                           | `text`   | Currently selected contents as plain text. For this to work, element field 'Enable text selection trigger' needs to be enabled.                                                                                                                         |
| [is focused](#is-focused)                                 | `yes/no` | Whether the editor content element has focus, such as when clicking inside the editor content.                                                                                                                                                          |
| [is dirty](#is-dirty)                                     | `yes/no` | Whether the editor is dirty or not. It will get dirty if the user has made modifications to the contents. It will get not dirty when the 'html/text content' state is updated, autobinding value is published and 'content changed' event is triggered. |
| [word count](#word-count)                                 | `number` | Current number of words in the editor content.                                                                                                                                                                                                          |
| [character count](#character-count)                       | `number` | Current number of characters in the editor content, including spaces.                                                                                                                                                                                   |
| [character count (no spaces)](#character-count-no-spaces) | `number` | Current number of characters in the editor content, excluding spaces.                                                                                                                                                                                   |

***

## Element states

### html content

**Type:** `text`

Current editor contents as HTML.

***

### text content

**Type:** `text`

Current editor contents as plain text.

***

### selected html

**Type:** `text`

Currently selected contents as HTML. For this to work, element field 'Enable text selection trigger' needs to be enabled.

***

### selected text

**Type:** `text`

Currently selected contents as plain text. For this to work, element field 'Enable text selection trigger' needs to be enabled.

***

### is focused

**Type:** `yes/no`

Whether the editor content element has focus, such as when clicking inside the editor content.

***

### is dirty

**Type:** `yes/no`

Whether the editor is dirty or not. It will get dirty if the user has made modifications to the contents. It will get not dirty when the 'html/text content' state is updated, autobinding value is published and 'content changed' event is triggered.

***

### word count

**Type:** `number`

Current number of words in the editor content.

***

### character count

**Type:** `number`

Current number of characters in the editor content, including spaces.

***

### character count (no spaces)

**Type:** `number`

Current number of characters in the editor content, excluding spaces.

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enhancio.gitbook.io/tinymce-rich-text-editor-for-bubble/element-reference/states.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
