{
  "doc": {
    "id": "api/commands/siblings",
    "title": "siblings | Cypress Documentation",
    "description": "Get sibling DOM elements in Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/commands/siblings.md",
    "version": "a8fd16711bdda4c7b5645b9717e588ae99ec2470",
    "updated_at": "2026-05-18T17:21:32.047Z",
    "headings": [
      {
        "id": "api/commands/siblings#siblings",
        "text": "siblings",
        "level": 1
      },
      {
        "id": "api/commands/siblings#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/commands/siblings#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/commands/siblings#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/commands/siblings#yields-learn-about-subject-management",
        "text": "Yields Learn about subject management",
        "level": 3
      },
      {
        "id": "api/commands/siblings#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/commands/siblings#no-args",
        "text": "No Args",
        "level": 3
      },
      {
        "id": "api/commands/siblings#get-the-siblings-of-each-li",
        "text": "Get the siblings of each li",
        "level": 4
      },
      {
        "id": "api/commands/siblings#selector",
        "text": "Selector",
        "level": 3
      },
      {
        "id": "api/commands/siblings#get-siblings-of-element-with-class-active",
        "text": "Get siblings of element with class active",
        "level": 4
      },
      {
        "id": "api/commands/siblings#rules",
        "text": "Rules",
        "level": 2
      },
      {
        "id": "api/commands/siblings#requirements-learn-about-chaining-commands",
        "text": "Requirements Learn about chaining commands",
        "level": 3
      },
      {
        "id": "api/commands/siblings#assertions-learn-about-assertions",
        "text": "Assertions Learn about assertions",
        "level": 3
      },
      {
        "id": "api/commands/siblings#timeouts-learn-about-timeouts",
        "text": "Timeouts Learn about timeouts",
        "level": 3
      },
      {
        "id": "api/commands/siblings#command-log",
        "text": "Command Log",
        "level": 2
      },
      {
        "id": "api/commands/siblings#history",
        "text": "History",
        "level": 2
      },
      {
        "id": "api/commands/siblings#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/commands/siblings#syntax",
      "doc_id": "api/commands/siblings",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\n.siblings().siblings(selector).siblings(options).siblings(selector, options)\n```\n\n### Usage\n\n**Correct Usage**\n\n```\ncy.get('td').siblings() // Yield all td's siblingscy.get('li').siblings('.active') // Yield all li's siblings with class '.active'\n```\n\n**Incorrect Usage**\n\n```\ncy.siblings('.error') // Errors, cannot be chained off 'cy'cy.clock().siblings() // Errors, 'clock' does not yield DOM elements\n```\n\n### Arguments\n\n**selector _(String selector)_**\n\nA selector used to filter matching DOM elements.\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.siblings()`.\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| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.siblings()` 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*   `.siblings()` yields the new DOM element(s) it found.\n*   `.siblings()` is a query, and it is _safe_ to chain further commands.\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/commands/siblings.json",
      "token_estimate": 192
    },
    {
      "id": "api/commands/siblings#usage",
      "doc_id": "api/commands/siblings",
      "heading": "Usage",
      "heading_level": 3,
      "content_markdown": "### Usage\n\n**Correct Usage**\n\n```\ncy.get('td').siblings() // Yield all td's siblingscy.get('li').siblings('.active') // Yield all li's siblings with class '.active'\n```\n\n**Incorrect Usage**\n\n```\ncy.siblings('.error') // Errors, cannot be chained off 'cy'cy.clock().siblings() // Errors, 'clock' does not yield DOM elements\n```\n",
      "section": "api",
      "anchors": [
        "usage"
      ],
      "path": "/llm/json/chunked/api/commands/siblings.json",
      "token_estimate": 53
    },
    {
      "id": "api/commands/siblings#arguments",
      "doc_id": "api/commands/siblings",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**selector _(String selector)_**\n\nA selector used to filter matching DOM elements.\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.siblings()`.\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| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.siblings()` to resolve before [timing out](#Timeouts) |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/commands/siblings.json",
      "token_estimate": 93
    },
    {
      "id": "api/commands/siblings#examples",
      "doc_id": "api/commands/siblings",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### No Args\n\n#### Get the siblings of each `li`\n\n```\n<ul>  <li>Home</li>  <li>Contact</li>  <li class=\"active\">Services</li>  <li>Price</li></ul>\n```\n\n```\n// yields all other li's in listcy.get('.active').siblings()\n```\n\n### Selector\n\n#### Get siblings of element with class `active`\n\n```\n// yields <li class=\"active\">Services</li>cy.get('li').siblings('.active')\n```\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/commands/siblings.json",
      "token_estimate": 60
    },
    {
      "id": "api/commands/siblings#rules",
      "doc_id": "api/commands/siblings",
      "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*   `.siblings()` requires being chained off a command that yields DOM element(s).\n\n### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)\n\n*   `.siblings()` will automatically [retry](/llm/markdown/app/core-concepts/retry-ability.md) until the element(s) [exist in the DOM](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Implicit-Assertions).\n*   `.siblings()` will automatically [retry](/llm/markdown/app/core-concepts/retry-ability.md) until all chained assertions have passed.\n\n### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)\n\n*   `.siblings()` can time out waiting for the element(s) to [exist in the DOM](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Implicit-Assertions).\n*   `.siblings()` can time out waiting for assertions you've added to pass.\n",
      "section": "api",
      "anchors": [
        "rules"
      ],
      "path": "/llm/json/chunked/api/commands/siblings.json",
      "token_estimate": 105
    },
    {
      "id": "api/commands/siblings#timeouts-learn-about-timeouts",
      "doc_id": "api/commands/siblings",
      "heading": "Timeouts Learn about timeouts",
      "heading_level": 3,
      "content_markdown": "### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)\n\n*   `.siblings()` can time out waiting for the element(s) to [exist in the DOM](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Implicit-Assertions).\n*   `.siblings()` can time out waiting for assertions you've added to pass.\n",
      "section": "api",
      "anchors": [
        "timeouts-learn-about-timeouts"
      ],
      "path": "/llm/json/chunked/api/commands/siblings.json",
      "token_estimate": 41
    },
    {
      "id": "api/commands/siblings#command-log",
      "doc_id": "api/commands/siblings",
      "heading": "Command Log",
      "heading_level": 2,
      "content_markdown": "## Command Log\n\n**_Get the siblings of element with class `active`_**\n\n```\ncy.get('.left-nav').find('li.active').siblings()\n```\n\nThe commands above will display in the Command Log as:\n\nWhen clicking on `siblings` within the command log, the console outputs the following:\n",
      "section": "api",
      "anchors": [
        "command-log"
      ],
      "path": "/llm/json/chunked/api/commands/siblings.json",
      "token_estimate": 49
    }
  ]
}