---
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!"
---

> This page is for Tiptap 2.x. [See the latest version of this page.](https://tiptap.dev/docs/editor/api/commands/nodes-and-marks/exit-code.md)

# 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()
```
