---
title: "setNodeSelection command"
description: "Use the setNodeSelection command in Tiptap to create a new NodeSelection at a given position. Learn more in our docs!"
canonical_url: "https://tiptap.dev/docs/editor/api/commands/selection/set-node-selection"
---

# setNodeSelection command

Use the setNodeSelection command in Tiptap to create a new NodeSelection at a given position. Learn more in our docs!

`setNodeSelection` creates a new NodeSelection at a given position. A node selection is a selection that points to a single node. [See more](https://prosemirror.net/docs/ref/#state.NodeSelection)

## Parameters

`position: number`

The position the NodeSelection will be created at.

## Use the setNodeSelection command

```js
editor.commands.setNodeSelection(10)
```
