---
title: "TinyMCE jQuery integration quick start guide"
description: "Documentation for the official TinyMCE jQuery integration."
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/jquery-cloud/"
md_url: "https://www.tiny.cloud/docs/tinymce/6/jquery-cloud/index.md"
version: "6"
last_updated: "2022-05-26T23:54:23Z"
tokens: 1010
---
Important This page documents TinyMCE 6. For new projects, Tiny recommends using the latest, most up-to-date version. [See TinyMCE 8 documentation](../../latest/jquery-cloud/).
# TinyMCE jQuery integration quick start guide

The [Official TinyMCE jQuery component](https://github.com/tinymce/tinymce-jquery) integrates TinyMCE into jQuery projects.

## Procedure

This procedure creates a basic jQuery integration containing a TinyMCE editor based on our [Basic example](../basic-example/).

1. Open an HTML file
2. Add a `<script>` element to get jQuery with a snippet from the official [jQuery CDN page](https://code.jquery.com/), which includes the `integrity` and `crossorigin` attributes.
3. Add the following `<script>` element to get TinyMCE from the Tiny Cloud:

```html
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
```
Replace `no-api-key` in the source script (`<script src=…​`) with a Tiny Cloud
API key, which is created when signing up to the [Tiny Cloud](/auth/signup/).
4. Add the following `<script>` element to get the TinyMCE jQuery integration from the JS Delivr CDN:

```html
<script src="https://cdn.jsdelivr.net/npm/@tinymce/tinymce-jquery@2/dist/tinymce-jquery.min.js"></script>
```
5. Add an initialization point for TinyMCE, such as:

```html
<div>
  <textarea id="tiny">&lt;p&gt;Encoded HTML content&lt;/p&gt;</textarea>
</div>
```
6. Add the TinyMCE jQuery init script. The TinyMCE selector is defined

in the jQuery prefix, and any other settings are defined in the object passed to
the `tinymce` method.

```html
<script>
  $('textarea#tiny').tinymce({ height: 500, /* other settings... */ });
</script>
```

## Example jQuery integration

To load a TinyMCE editor similar to the [Basic example](../basic-example/), add the following code to an empty HTML file.

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script
      src="https://code.jquery.com/jquery-3.6.0.min.js"
      integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
      crossorigin="anonymous"
    ></script>
    <script
      src="https://cdn.tiny.cloud/1/no-api-key/tinymce/6/tinymce.min.js"
      referrerpolicy="origin"
    ></script>
    <script src="https://cdn.jsdelivr.net/npm/@tinymce/tinymce-jquery@2/dist/tinymce-jquery.min.js"></script>
  </head>
  <body>
    <div>
      <textarea id="tiny">&lt;p&gt;Welcome to the TinyMCE jQuery example!&lt;/p&gt;</textarea>
    </div>
    <script>
      $('textarea#tiny').tinymce({
        height: 500,
        menubar: false,
        plugins: [
          'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
          'anchor', 'searchreplace', 'visualblocks', 'fullscreen',
          'insertdatetime', 'media', 'table', 'code', 'help', 'wordcount'
        ],
        toolbar: 'undo redo | blocks | bold italic backcolor | ' +
          'alignleft aligncenter alignright alignjustify | ' +
          'bullist numlist outdent indent | removeformat | help'
      });
    </script>
  </body>
</html>
```

## TinyMCE in a jQuery UI Dialog

To render TinyMCE instances inside jQuery UI dialogs, add the following code:

```js
// Prevent jQuery UI dialog from blocking focusin
$(document).on('focusin', function(e) {
  if ($(e.target).closest(".tox-tinymce, .tox-tinymce-aux, .moxman-window, .tam-assetmanager-root").length) {
    e.stopImmediatePropagation();
  }
});
```
This code is required because jQuery blocks all `focusin` calls from elements outside the dialog. For a working example, [try this TinyMCE fiddle](http://fiddle.tiny.cloud/ZZhaab/4).
