{
  "doc": {
    "id": "api/cypress-api/dom",
    "title": "Cypress.dom | Cypress Documentation",
    "description": "Cypress.dom.method() is a collection of DOM related helper methods in Cypress",
    "section": "api",
    "source_path": "/llm/markdown/api/cypress-api/dom.md",
    "version": "48b03b5502f7aea1d0454750cce208f775403542",
    "updated_at": "2026-05-20T19:00:20.270Z",
    "headings": [
      {
        "id": "api/cypress-api/dom#cypress-dom",
        "text": "Cypress.dom",
        "level": 1
      },
      {
        "id": "api/cypress-api/dom#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/cypress-api/dom#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/cypress-api/dom#is-attached",
        "text": "Is attached",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-descendent",
        "text": "Is descendent",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-detached",
        "text": "Is detached",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-document",
        "text": "Is document",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-dom",
        "text": "Is DOM",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-element",
        "text": "Is element",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-focusable",
        "text": "Is focusable",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-focused",
        "text": "Is focused",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-hidden",
        "text": "Is hidden",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-jquery",
        "text": "Is jQuery",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-scrollable",
        "text": "Is scrollable",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-visible",
        "text": "Is visible",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#is-window",
        "text": "Is window",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#unwrap",
        "text": "Unwrap",
        "level": 3
      },
      {
        "id": "api/cypress-api/dom#wrap",
        "text": "Wrap",
        "level": 3
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "Cypress.dom"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "`Cypress.dom.method()` is a collection of DOM related helper methods."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "There are actually dozens of methods attached to `Cypress.dom` that are not documented below. These methods are used internally by Cypress in nearly every single built in command."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "We suggest "
          },
          {
            "type": "link",
            "title": null,
            "url": "https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/dom/index.ts",
            "children": [
              {
                "type": "text",
                "value": "reading through the source code here"
              }
            ]
          },
          {
            "type": "text",
            "value": " to see all of the methods and what they do."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Syntax"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "Cypress.dom.isHidden(element)"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Examples"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is attached"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an element is attached to the DOM."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('button').then(($el) => {  Cypress.dom.isAttached($el) // true})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is descendent"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an element is a descendent of another element."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('div').then(($el) => {  Cypress.dom.isDescendent($el.parent(), $el) // true})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is detached"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an element is detached from the DOM."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('button').then(($el) => {  Cypress.dom.isDetached($el) // false})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is document"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether a node is of document type."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('p').then(($el) => {  Cypress.dom.isDocument($el) // false})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is DOM"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an object is a DOM object."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('body').then(($el) => {  Cypress.dom.isDom($el) // true})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is element"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an object is a DOM element."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('p').then(($el) => {  Cypress.dom.isElement($el) // true})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is focusable"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an element can receive focus."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Cypress internally uses this method everywhere to figure out whether an element is hidden, "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/interacting-with-elements.md",
            "children": [
              {
                "type": "text",
                "value": "mostly for actionability"
              }
            ]
          },
          {
            "type": "text",
            "value": "."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('input').then(($el) => {  Cypress.dom.isFocusable($el) // true})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is focused"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an element currently has focus."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('button').then(($el) => {  Cypress.dom.isFocused($el)})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is hidden"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an element is hidden."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Cypress internally uses this method everywhere to figure out whether an element is hidden, "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/interacting-with-elements.md",
            "children": [
              {
                "type": "text",
                "value": "mostly for actionability"
              }
            ]
          },
          {
            "type": "text",
            "value": "."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('p').then(($el) => {  Cypress.dom.isHidden($el) // false})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is jQuery"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an object is a jQuery object."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('input').then(($el) => {  Cypress.dom.isJquery($el)})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is scrollable"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an element is scrollable."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Cypress internally uses this method everywhere to figure out whether an element can be scrolled, "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/interacting-with-elements.md",
            "children": [
              {
                "type": "text",
                "value": "mostly for actionability"
              }
            ]
          },
          {
            "type": "text",
            "value": "."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('body').then(($el) => {  Cypress.dom.isScrollable($el) // true})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is visible"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an element is visible."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('img').then(($el) => {  Cypress.dom.isVisible($el) // true})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Is window"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a boolean indicating whether an object is a window object."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get(window).then(($el) => {  Cypress.dom.isWindow($el) // true})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Unwrap"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns an array of raw elements pulled out from a jQuery object."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('body').then(($el) => {  Cypress.dom.unwrap($el)})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Wrap"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Returns a jQuery object obtained by wrapping an object in jQuery."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('p').then(($el) => {  Cypress.dom.wrap($el)})"
      }
    ]
  },
  "token_estimate": 579
}