---
title: "updateAttributes command"
description: "Use the updateAttributes command in Tiptap to set new attribute values for a node or mark. Learn more in our docs!"
canonical_url: "https://tiptap.dev/docs/editor/api/commands/nodes-and-marks/update-attributes"
---

# updateAttributes command

Use the updateAttributes command in Tiptap to set new attribute values for a node or mark. Learn more in our docs!

The `updateAttributes` command sets attributes of a node or mark to new values. Not passed attributes won’t be touched.

See also: [extendMarkRange](https://tiptap.dev/docs/editor/api/commands/nodes-and-marks/extend-mark-range.md)

## Parameters

`typeOrName: string | NodeType | MarkType`

Pass the type you want to update, for example `'heading'`.

`attributes: Record<string, any>`

This expects an object with the attributes that need to be updated. It doesn’t need to have all attributes.

## Use the updateAttributes command

```js
// Update node attributes
editor.commands.updateAttributes('heading', { level: 1 })

// Update mark attributes
editor.commands.updateAttributes('highlight', { color: 'pink' })
```
