---
title: "exitCode command"
description: "Use the exitCode command in Tiptap to exit code blocks and continue editing in a new default block. More in our docs!"
canonical_url: "https://tiptap.dev/docs/editor/api/commands/nodes-and-marks/exit-code"
---

# exitCode command

Use the exitCode command in Tiptap to exit code blocks and continue editing in a new default block. More in our docs!

The `exitCode` command will create a default block after the current selection if the selection is a `code` element and move the cursor to the new block.

## Use the exitCode command

```js
editor.commands.exitCode()
```
