# Obtain the Cursor Position of the Editor

## Environment

<table>
	<tr>
		<td>Product</td>
		<td>Progress® Kendo UI® for Angular Editor</td>
	</tr>
</table>

## Description

How to obtain the cursor position of the Editor component?

## Solution

The Editor [`view`](https://www.telerik.com/kendo-angular-ui/components/editor/api/editorcomponent#fields) exposes the ProseMirror [EditorView](https://prosemirror.net/docs/ref/#view.EditorView) instance. It provides access to the current Editor [state](https://prosemirror.net/docs/ref/#state.EditorState) and [selection](https://prosemirror.net/docs/ref/#state.Selection).

Use the selection [$anchor](https://prosemirror.net/docs/ref/#state.Selection.$anchor) that returns the resolved position if this is a cursor selection, or null otherwise. Then the position can be used to insert a specific HTML element or any other operation that will require the position of the cursor inside the Editor.

The following example demonstrates the Editor cursor position on button click.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/knowledge-base/editor-cursor-position/source.txt)

## Suggested Links

* [ProseMirror Documentation Manual](https://prosemirror.net/docs/ref/)
