{
  "doc": {
    "id": "api/commands/blur",
    "title": "blur | Cypress Documentation",
    "description": "Blur a focused element in Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/commands/blur.md",
    "version": "24a73f8a97175663aaffd3b016289fb2a523a4ea",
    "updated_at": "2026-05-14T20:17:33.301Z",
    "headings": [
      {
        "id": "api/commands/blur#blur",
        "text": "blur",
        "level": 1
      },
      {
        "id": "api/commands/blur#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/commands/blur#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/commands/blur#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/commands/blur#yields-learn-about-subject-management",
        "text": "Yields Learn about subject management",
        "level": 3
      },
      {
        "id": "api/commands/blur#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/commands/blur#no-args",
        "text": "No Args",
        "level": 3
      },
      {
        "id": "api/commands/blur#blur-the-comment-input",
        "text": "Blur the comment input",
        "level": 4
      },
      {
        "id": "api/commands/blur#options",
        "text": "Options",
        "level": 3
      },
      {
        "id": "api/commands/blur#blur-the-first-input",
        "text": "Blur the first input",
        "level": 4
      },
      {
        "id": "api/commands/blur#notes",
        "text": "Notes",
        "level": 2
      },
      {
        "id": "api/commands/blur#actionability",
        "text": "Actionability",
        "level": 3
      },
      {
        "id": "api/commands/blur#blur-is-not-an-action-command",
        "text": "Blur is not an action command",
        "level": 4
      },
      {
        "id": "api/commands/blur#timeouts",
        "text": "Timeouts",
        "level": 3
      },
      {
        "id": "api/commands/blur#blur-can-time-out-because-your-browser-did-not-receive-any-blur-events",
        "text": ".blur() can time out because your browser did not receive any blur events",
        "level": 4
      },
      {
        "id": "api/commands/blur#rules",
        "text": "Rules",
        "level": 2
      },
      {
        "id": "api/commands/blur#requirements-learn-about-chaining-commands",
        "text": "Requirements Learn about chaining commands",
        "level": 3
      },
      {
        "id": "api/commands/blur#assertions-learn-about-assertions",
        "text": "Assertions Learn about assertions",
        "level": 3
      },
      {
        "id": "api/commands/blur#timeouts-learn-about-timeouts",
        "text": "Timeouts Learn about timeouts",
        "level": 3
      },
      {
        "id": "api/commands/blur#command-log",
        "text": "Command Log",
        "level": 2
      },
      {
        "id": "api/commands/blur#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/commands/blur#syntax",
      "doc_id": "api/commands/blur",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\n.blur().blur(options)\n```\n\n### Usage\n\n**Correct Usage**\n\n```\ncy.get('[type=\"email\"]').blur() // Blur email inputcy.get('[tabindex=\"1\"]').blur() // Blur el with tabindex\n```\n\n**Incorrect Usage**\n\n```\ncy.blur('input') // Errors, cannot be chained off 'cy'cy.window().blur() // Errors, 'window' does not yield DOM element\n```\n\n### Arguments\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.blur`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `force` | `false` | Forces the action, disables checking if [element is focused](#Requirements) |\n| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.blur()` to resolve before [timing out](#Timeouts) |\n\n### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n*   `.blur()` yields the same subject it was given.\n*   It is [unsafe](/llm/markdown/app/core-concepts/retry-ability.md#Only-queries-are-retried) to chain further commands that rely on the subject after `.blur()`.\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 193
    },
    {
      "id": "api/commands/blur#usage",
      "doc_id": "api/commands/blur",
      "heading": "Usage",
      "heading_level": 3,
      "content_markdown": "### Usage\n\n**Correct Usage**\n\n```\ncy.get('[type=\"email\"]').blur() // Blur email inputcy.get('[tabindex=\"1\"]').blur() // Blur el with tabindex\n```\n\n**Incorrect Usage**\n\n```\ncy.blur('input') // Errors, cannot be chained off 'cy'cy.window().blur() // Errors, 'window' does not yield DOM element\n```\n",
      "section": "api",
      "anchors": [
        "usage"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 48
    },
    {
      "id": "api/commands/blur#arguments",
      "doc_id": "api/commands/blur",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.blur`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `force` | `false` | Forces the action, disables checking if [element is focused](#Requirements) |\n| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.blur()` to resolve before [timing out](#Timeouts) |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 99
    },
    {
      "id": "api/commands/blur#yields-learn-about-subject-management",
      "doc_id": "api/commands/blur",
      "heading": "Yields Learn about subject management",
      "heading_level": 3,
      "content_markdown": "### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n*   `.blur()` yields the same subject it was given.\n*   It is [unsafe](/llm/markdown/app/core-concepts/retry-ability.md#Only-queries-are-retried) to chain further commands that rely on the subject after `.blur()`.\n",
      "section": "api",
      "anchors": [
        "yields-learn-about-subject-management"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 40
    },
    {
      "id": "api/commands/blur#examples",
      "doc_id": "api/commands/blur",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### No Args\n\n#### Blur the comment input\n\n```\ncy.get('[name=\"comment\"]').type('Nice Product!')cy.get('[name=\"comment\"]').blur()\n```\n\n### Options\n\n#### Blur the first input\n\nSetting `force` to `true` in the options disables checking whether the input is focusable or currently has focus.\n\n```\ncy.get('input:first').blur({ force: true })\n```\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 60
    },
    {
      "id": "api/commands/blur#options",
      "doc_id": "api/commands/blur",
      "heading": "Options",
      "heading_level": 3,
      "content_markdown": "### Options\n\n#### Blur the first input\n\nSetting `force` to `true` in the options disables checking whether the input is focusable or currently has focus.\n\n```\ncy.get('input:first').blur({ force: true })\n```\n",
      "section": "api",
      "anchors": [
        "options"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 41
    },
    {
      "id": "api/commands/blur#notes",
      "doc_id": "api/commands/blur",
      "heading": "Notes",
      "heading_level": 2,
      "content_markdown": "## Notes\n\n### Actionability\n\n#### Blur is not an action command\n\n`.blur()` is not implemented like other action commands, and does not follow the same rules of [waiting for actionability](/llm/markdown/app/core-concepts/interacting-with-elements.md).\n\n`.blur()` is a helpful command used as a shortcut. Normally there's no way for a user to \"blur\" an element. Typically the user would have to perform **another** action like clicking or tabbing to a different element. Needing to perform a separate action like this is very indirect.\n\nTherefore it's often much more efficient to test the blur behavior directly with `.blur()`.\n\n### Timeouts\n\n#### `.blur()` can time out because your browser did not receive any blur events\n\nIf you see this error, you may want to ensure that the main browser window is currently focused. This means not being focused in debugger or any other window when the command is run.\n\nInternally Cypress does account for this, and will polyfill the blur events when necessary to replicate what the browser does. Unfortunately the browser will still behave differently when not in focus - for instance it may throttle async events. Your best bet here is to keep Cypress focused when working on a test.\n",
      "section": "api",
      "anchors": [
        "notes"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 260
    },
    {
      "id": "api/commands/blur#actionability",
      "doc_id": "api/commands/blur",
      "heading": "Actionability",
      "heading_level": 3,
      "content_markdown": "### Actionability\n\n#### Blur is not an action command\n\n`.blur()` is not implemented like other action commands, and does not follow the same rules of [waiting for actionability](/llm/markdown/app/core-concepts/interacting-with-elements.md).\n\n`.blur()` is a helpful command used as a shortcut. Normally there's no way for a user to \"blur\" an element. Typically the user would have to perform **another** action like clicking or tabbing to a different element. Needing to perform a separate action like this is very indirect.\n\nTherefore it's often much more efficient to test the blur behavior directly with `.blur()`.\n",
      "section": "api",
      "anchors": [
        "actionability"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 120
    },
    {
      "id": "api/commands/blur#blur-is-not-an-action-command",
      "doc_id": "api/commands/blur",
      "heading": "Blur is not an action command",
      "heading_level": 4,
      "content_markdown": "#### Blur is not an action command\n\n`.blur()` is not implemented like other action commands, and does not follow the same rules of [waiting for actionability](/llm/markdown/app/core-concepts/interacting-with-elements.md).\n\n`.blur()` is a helpful command used as a shortcut. Normally there's no way for a user to \"blur\" an element. Typically the user would have to perform **another** action like clicking or tabbing to a different element. Needing to perform a separate action like this is very indirect.\n\nTherefore it's often much more efficient to test the blur behavior directly with `.blur()`.\n",
      "section": "api",
      "anchors": [
        "blur-is-not-an-action-command"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 117
    },
    {
      "id": "api/commands/blur#timeouts",
      "doc_id": "api/commands/blur",
      "heading": "Timeouts",
      "heading_level": 3,
      "content_markdown": "### Timeouts\n\n#### `.blur()` can time out because your browser did not receive any blur events\n\nIf you see this error, you may want to ensure that the main browser window is currently focused. This means not being focused in debugger or any other window when the command is run.\n\nInternally Cypress does account for this, and will polyfill the blur events when necessary to replicate what the browser does. Unfortunately the browser will still behave differently when not in focus - for instance it may throttle async events. Your best bet here is to keep Cypress focused when working on a test.\n",
      "section": "api",
      "anchors": [
        "timeouts"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 137
    },
    {
      "id": "api/commands/blur#blur-can-time-out-because-your-browser-did-not-receive-any-blur-events",
      "doc_id": "api/commands/blur",
      "heading": ".blur() can time out because your browser did not receive any blur events",
      "heading_level": 4,
      "content_markdown": "#### `.blur()` can time out because your browser did not receive any blur events\n\nIf you see this error, you may want to ensure that the main browser window is currently focused. This means not being focused in debugger or any other window when the command is run.\n\nInternally Cypress does account for this, and will polyfill the blur events when necessary to replicate what the browser does. Unfortunately the browser will still behave differently when not in focus - for instance it may throttle async events. Your best bet here is to keep Cypress focused when working on a test.\n",
      "section": "api",
      "anchors": [
        "blur-can-time-out-because-your-browser-did-not-receive-any-blur-events"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 135
    },
    {
      "id": "api/commands/blur#rules",
      "doc_id": "api/commands/blur",
      "heading": "Rules",
      "heading_level": 2,
      "content_markdown": "## Rules\n\n### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)\n\n*   `.blur()` requires being chained off a command that yields DOMelement(s).\n*   `.blur()` requires the element to currently have focus.\n*   `.blur()` requires the element to be able to receive focus.\n\n### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)\n\n*   `.blur()` will automatically wait for assertions you have chained to pass.\n\n### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)\n\n*   `.blur()` can time out waiting for assertions you've added to pass.\n",
      "section": "api",
      "anchors": [
        "rules"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 97
    },
    {
      "id": "api/commands/blur#requirements-learn-about-chaining-commands",
      "doc_id": "api/commands/blur",
      "heading": "Requirements Learn about chaining commands",
      "heading_level": 3,
      "content_markdown": "### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)\n\n*   `.blur()` requires being chained off a command that yields DOMelement(s).\n*   `.blur()` requires the element to currently have focus.\n*   `.blur()` requires the element to be able to receive focus.\n",
      "section": "api",
      "anchors": [
        "requirements-learn-about-chaining-commands"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 49
    },
    {
      "id": "api/commands/blur#command-log",
      "doc_id": "api/commands/blur",
      "heading": "Command Log",
      "heading_level": 2,
      "content_markdown": "## Command Log\n\n**_Blur a textarea after typing._**\n\n```\ncy.get('[name=\"comment\"]').focus()cy.get('[name=\"comment\"]').type('Nice Product!')cy.get('[name=\"comment\"]').blur()\n```\n\nThe commands above will display in the Command Log as:\n\nWhen clicking on the `blur` command within the command log, the console outputs the following:\n",
      "section": "api",
      "anchors": [
        "command-log"
      ],
      "path": "/llm/json/chunked/api/commands/blur.json",
      "token_estimate": 49
    }
  ]
}