---
title: "Anchor plugin"
description: "Insert anchors (sometimes referred to as a bookmarks)."
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/anchor/"
md_url: "https://www.tiny.cloud/docs/tinymce/5/anchor/index.md"
version: "5"
last_updated: "2024-04-16T01:50:26Z"
tokens: 231
---
Important This page documents TinyMCE 5. For new projects, Tiny recommends using the latest, most up-to-date version. [See TinyMCE 8 documentation](../../latest/anchor/).
# Anchor plugin

This plugin adds an anchor/bookmark button to the toolbar that inserts an anchor at the editor’s cursor insertion point. It also adds the menu item `anchor` under the `Insert` menu.

When a user clicks on the anchor button or menu item they will be prompted via a dialog box to enter a string. The string will be inserted into the HTML as an anchor id at the location of the cursor. For example, a user places their cursor at the beginning of "Hello World" and clicks on the anchor button and enters "start" in the dialog box. The resulting HTML will take the form of `<p><a id="start"></a>Hello, World!</p>`.

## Basic setup

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'anchor',
  toolbar: 'anchor',
  menubar: 'insert'
});
```
