{
  "doc": {
    "id": "api/commands/type",
    "title": "type | Cypress Documentation",
    "description": "Type into a DOM element in Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/commands/type.md",
    "version": "e6988a974973e9090ce70406c38cb2b9e0eac9fa",
    "updated_at": "2026-05-15T15:50:22.536Z",
    "headings": [
      {
        "id": "api/commands/type#type",
        "text": "type",
        "level": 1
      },
      {
        "id": "api/commands/type#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/commands/type#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/commands/type#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/commands/type#yields-learn-about-subject-management",
        "text": "Yields Learn about subject management",
        "level": 3
      },
      {
        "id": "api/commands/type#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/commands/type#input-textarea",
        "text": "Input/Textarea",
        "level": 3
      },
      {
        "id": "api/commands/type#type-into-a-textarea",
        "text": "Type into a textarea.",
        "level": 4
      },
      {
        "id": "api/commands/type#type-into-a-login-form",
        "text": "Type into a login form",
        "level": 4
      },
      {
        "id": "api/commands/type#mimic-user-typing-behavior",
        "text": "Mimic user typing behavior",
        "level": 4
      },
      {
        "id": "api/commands/type#selecting-an-option-from-datalist",
        "text": "'Selecting' an option from datalist",
        "level": 4
      },
      {
        "id": "api/commands/type#tabindex",
        "text": "Tabindex",
        "level": 3
      },
      {
        "id": "api/commands/type#type-into-a-non-input-or-non-textarea-element-with-tabindex",
        "text": "Type into a non-input or non-textarea element with tabindex",
        "level": 4
      },
      {
        "id": "api/commands/type#date-inputs",
        "text": "Date Inputs",
        "level": 3
      },
      {
        "id": "api/commands/type#month-inputs",
        "text": "Month Inputs",
        "level": 3
      },
      {
        "id": "api/commands/type#week-inputs",
        "text": "Week Inputs",
        "level": 3
      },
      {
        "id": "api/commands/type#time-inputs",
        "text": "Time Inputs",
        "level": 3
      },
      {
        "id": "api/commands/type#key-combinations",
        "text": "Key Combinations",
        "level": 3
      },
      {
        "id": "api/commands/type#type-a-key-combination",
        "text": "Type a key combination",
        "level": 4
      },
      {
        "id": "api/commands/type#type-literal-or-characters",
        "text": "Type literal { or } characters",
        "level": 4
      },
      {
        "id": "api/commands/type#hold-down-modifier-key-and-type-a-word",
        "text": "Hold down modifier key and type a word",
        "level": 4
      },
      {
        "id": "api/commands/type#release-behavior",
        "text": "Release behavior",
        "level": 4
      },
      {
        "id": "api/commands/type#global-shortcuts",
        "text": "Global Shortcuts",
        "level": 3
      },
      {
        "id": "api/commands/type#use-keyboard-shortcuts-in-body",
        "text": "Use keyboard shortcuts in body",
        "level": 4
      },
      {
        "id": "api/commands/type#do-a-shift-click",
        "text": "Do a shift + click",
        "level": 4
      },
      {
        "id": "api/commands/type#combined-usage-with-cy-press",
        "text": "Combined Usage with cy.press()",
        "level": 3
      },
      {
        "id": "api/commands/type#form-navigation-with-keyboard",
        "text": "Form navigation with keyboard",
        "level": 4
      },
      {
        "id": "api/commands/type#options",
        "text": "Options",
        "level": 3
      },
      {
        "id": "api/commands/type#force-typing-regardless-of-its-actionable-state",
        "text": "Force typing regardless of its actionable state",
        "level": 4
      },
      {
        "id": "api/commands/type#notes",
        "text": "Notes",
        "level": 2
      },
      {
        "id": "api/commands/type#supported-elements",
        "text": "Supported Elements",
        "level": 3
      },
      {
        "id": "api/commands/type#actionability",
        "text": "Actionability",
        "level": 3
      },
      {
        "id": "api/commands/type#events",
        "text": "Events",
        "level": 3
      },
      {
        "id": "api/commands/type#when-element-is-not-in-focus",
        "text": "When element is not in focus",
        "level": 4
      },
      {
        "id": "api/commands/type#events-that-fire",
        "text": "Events that fire",
        "level": 4
      },
      {
        "id": "api/commands/type#event-firing",
        "text": "Event Firing",
        "level": 4
      },
      {
        "id": "api/commands/type#event-cancellation",
        "text": "Event Cancellation",
        "level": 4
      },
      {
        "id": "api/commands/type#preventing-mousedown-does-not-prevent-typing",
        "text": "Preventing mousedown does not prevent typing",
        "level": 4
      },
      {
        "id": "api/commands/type#key-events-table",
        "text": "Key Events Table",
        "level": 4
      },
      {
        "id": "api/commands/type#when-to-use-cy-press",
        "text": "When to use cy.press()",
        "level": 3
      },
      {
        "id": "api/commands/type#modifiers",
        "text": "Modifiers",
        "level": 3
      },
      {
        "id": "api/commands/type#modifier-effects",
        "text": "Modifier effects",
        "level": 4
      },
      {
        "id": "api/commands/type#form-submission",
        "text": "Form Submission",
        "level": 3
      },
      {
        "id": "api/commands/type#implicit-form-submission-behavior",
        "text": "Implicit form submission behavior",
        "level": 4
      },
      {
        "id": "api/commands/type#rules",
        "text": "Rules",
        "level": 2
      },
      {
        "id": "api/commands/type#requirements-learn-about-chaining-commands",
        "text": "Requirements Learn about chaining commands",
        "level": 3
      },
      {
        "id": "api/commands/type#assertions-learn-about-assertions",
        "text": "Assertions Learn about assertions",
        "level": 3
      },
      {
        "id": "api/commands/type#timeouts-learn-about-timeouts",
        "text": "Timeouts Learn about timeouts",
        "level": 3
      },
      {
        "id": "api/commands/type#command-log",
        "text": "Command Log",
        "level": 2
      },
      {
        "id": "api/commands/type#history",
        "text": "History",
        "level": 2
      },
      {
        "id": "api/commands/type#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/commands/type#syntax",
      "doc_id": "api/commands/type",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\n.type(text).type(text, options)\n```\n\n### Usage\n\n**Correct Usage**\n\n```\ncy.get('input').type('Hello, World') // Type 'Hello, World' into the 'input'\n```\n\n**Incorrect Usage**\n\n```\ncy.type('Welcome') // Errors, cannot be chained off 'cy'cy.clock().type('www.cypress.io') // Errors, 'clock' does not yield DOM elements\n```\n\n### Arguments\n\n**text _(String)_**\n\nThe text to be typed into the DOM element.\n\nText passed to `.type()` may include any of the special character sequences below. These characters will pass along the correct `keyCode`, `key`, and `which` codes to any events issued during `.type()`. Some of the special character sequences may perform actions during typing such as `{moveToEnd}`, `{moveToStart}`, or `{selectAll}`.\n\nTo disable parsing special characters sequences, set the `parseSpecialCharSequences` option to `false`.\n\n| Sequence | Notes |\n| --- | --- |\n| `{{}` | Types the literal `{` key |\n| `{backspace}` | Deletes character to the left of the cursor |\n| `{del}` | Deletes character to the right of the cursor |\n| `{downArrow}` | Moves cursor down |\n| `{end}` | Moves cursor to the end of the line |\n| `{enter}` | Types the Enter key |\n| `{esc}` | Types the Escape key |\n| `{home}` | Moves cursor to the start of the line |\n| `{insert}` | Inserts character to the right of the cursor |\n| `{leftArrow}` | Moves cursor left |\n| `{moveToEnd}` | Moves cursor to end of typeable element |\n| `{moveToStart}` | Moves cursor to the start of typeable element |\n| `{pageDown}` | Scrolls down |\n| `{pageUp}` | Scrolls up |\n| `{rightArrow}` | Moves cursor right |\n| `{selectAll}` | Selects all text by creating a `selection range` |\n| `{upArrow}` | Moves cursor up |\n\n**Note**: For navigation keys like `Tab`, `Arrow` keys, and `Enter` in non-form contexts, consider using [`cy.press()`](/llm/markdown/api/commands/press.md) for more accurate native keyboard event simulation.\n\nText passed to `.type()` may also include any of these modifier character sequences:\n\n| Sequence | Notes |\n| --- | --- |\n| `{alt}` | Activates the `altKey` modifier. Aliases: `{option}` |\n| `{ctrl}` | Activates the `ctrlKey` modifier. Aliases: `{control}` |\n| `{meta}` | Activates the `metaKey` modifier. Aliases: `{command}`, `{cmd}` |\n| `{shift}` | Activates the `shiftKey` modifier. |\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.type()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `animationDistanceThreshold` | [`animationDistanceThreshold`](/llm/markdown/app/references/configuration.md#Actionability) | The distance in pixels an element must exceed over time to be [considered animating](/llm/markdown/app/core-concepts/interacting-with-elements.md#Animations). |\n| `delay` | `10` | Delay after each keypress |\n| `force` | `false` | Forces the action, disables [waiting for actionability](#Assertions) |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `parseSpecialCharSequences` | `true` | Parse special characters for strings surrounded by `{}`, such as `{esc}`. Set to `false` to type the literal characters instead |\n| `release` | `true` | Keep a modifier activated between commands |\n| `scrollBehavior` | [`scrollBehavior`](/llm/markdown/app/references/configuration.md#Actionability) | Viewport position to where an element [should be scrolled](/llm/markdown/app/core-concepts/interacting-with-elements.md#Scrolling) before executing the command |\n| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.type()` to resolve before [timing out](#Timeouts) |\n| `waitForAnimations` | [`waitForAnimations`](/llm/markdown/app/references/configuration.md#Actionability) | Whether to wait for elements to [finish animating](/llm/markdown/app/core-concepts/interacting-with-elements.md#Animations) before executing the command. |\n\n### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n*   `.type()` 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 `.type()`.\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 765
    },
    {
      "id": "api/commands/type#usage",
      "doc_id": "api/commands/type",
      "heading": "Usage",
      "heading_level": 3,
      "content_markdown": "### Usage\n\n**Correct Usage**\n\n```\ncy.get('input').type('Hello, World') // Type 'Hello, World' into the 'input'\n```\n\n**Incorrect Usage**\n\n```\ncy.type('Welcome') // Errors, cannot be chained off 'cy'cy.clock().type('www.cypress.io') // Errors, 'clock' does not yield DOM elements\n```\n",
      "section": "api",
      "anchors": [
        "usage"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 47
    },
    {
      "id": "api/commands/type#arguments",
      "doc_id": "api/commands/type",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**text _(String)_**\n\nThe text to be typed into the DOM element.\n\nText passed to `.type()` may include any of the special character sequences below. These characters will pass along the correct `keyCode`, `key`, and `which` codes to any events issued during `.type()`. Some of the special character sequences may perform actions during typing such as `{moveToEnd}`, `{moveToStart}`, or `{selectAll}`.\n\nTo disable parsing special characters sequences, set the `parseSpecialCharSequences` option to `false`.\n\n| Sequence | Notes |\n| --- | --- |\n| `{{}` | Types the literal `{` key |\n| `{backspace}` | Deletes character to the left of the cursor |\n| `{del}` | Deletes character to the right of the cursor |\n| `{downArrow}` | Moves cursor down |\n| `{end}` | Moves cursor to the end of the line |\n| `{enter}` | Types the Enter key |\n| `{esc}` | Types the Escape key |\n| `{home}` | Moves cursor to the start of the line |\n| `{insert}` | Inserts character to the right of the cursor |\n| `{leftArrow}` | Moves cursor left |\n| `{moveToEnd}` | Moves cursor to end of typeable element |\n| `{moveToStart}` | Moves cursor to the start of typeable element |\n| `{pageDown}` | Scrolls down |\n| `{pageUp}` | Scrolls up |\n| `{rightArrow}` | Moves cursor right |\n| `{selectAll}` | Selects all text by creating a `selection range` |\n| `{upArrow}` | Moves cursor up |\n\n**Note**: For navigation keys like `Tab`, `Arrow` keys, and `Enter` in non-form contexts, consider using [`cy.press()`](/llm/markdown/api/commands/press.md) for more accurate native keyboard event simulation.\n\nText passed to `.type()` may also include any of these modifier character sequences:\n\n| Sequence | Notes |\n| --- | --- |\n| `{alt}` | Activates the `altKey` modifier. Aliases: `{option}` |\n| `{ctrl}` | Activates the `ctrlKey` modifier. Aliases: `{control}` |\n| `{meta}` | Activates the `metaKey` modifier. Aliases: `{command}`, `{cmd}` |\n| `{shift}` | Activates the `shiftKey` modifier. |\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.type()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `animationDistanceThreshold` | [`animationDistanceThreshold`](/llm/markdown/app/references/configuration.md#Actionability) | The distance in pixels an element must exceed over time to be [considered animating](/llm/markdown/app/core-concepts/interacting-with-elements.md#Animations). |\n| `delay` | `10` | Delay after each keypress |\n| `force` | `false` | Forces the action, disables [waiting for actionability](#Assertions) |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `parseSpecialCharSequences` | `true` | Parse special characters for strings surrounded by `{}`, such as `{esc}`. Set to `false` to type the literal characters instead |\n| `release` | `true` | Keep a modifier activated between commands |\n| `scrollBehavior` | [`scrollBehavior`](/llm/markdown/app/references/configuration.md#Actionability) | Viewport position to where an element [should be scrolled](/llm/markdown/app/core-concepts/interacting-with-elements.md#Scrolling) before executing the command |\n| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.type()` to resolve before [timing out](#Timeouts) |\n| `waitForAnimations` | [`waitForAnimations`](/llm/markdown/app/references/configuration.md#Actionability) | Whether to wait for elements to [finish animating](/llm/markdown/app/core-concepts/interacting-with-elements.md#Animations) before executing the command. |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 671
    },
    {
      "id": "api/commands/type#yields-learn-about-subject-management",
      "doc_id": "api/commands/type",
      "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*   `.type()` 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 `.type()`.\n",
      "section": "api",
      "anchors": [
        "yields-learn-about-subject-management"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 40
    },
    {
      "id": "api/commands/type#examples",
      "doc_id": "api/commands/type",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### Input/Textarea\n\n#### Type into a textarea.\n\n```\ncy.get('textarea').type('Hello world') // yields <textarea>\n```\n\n#### Type into a login form\n\n[Check out our example recipe of logging in by typing username and password in HTML web forms](/llm/markdown/app/references/recipes.md#Logging-In)\n\n#### Mimic user typing behavior\n\nEach keypress is delayed 10ms by default in order to simulate how a very fast user types!\n\n```\ncy.get('[contenteditable]').type('some text!')\n```\n\n#### 'Selecting' an option from datalist\n\nFor 'selecting' an option, just type it into the input.\n\n```\n<input list=\"fruit\" /><datalist id=\"fruit\">  <option>Apple</option>  <option>Banana</option>  <option>Cantaloupe</option></datalist>\n```\n\n```\ncy.get('input').type('Apple')\n```\n\n### Tabindex\n\n#### Type into a non-input or non-textarea element with `tabindex`\n\n```\n<body>  <div id=\"el\" tabindex=\"1\">This div can receive focus!</div></body>\n```\n\n```\ncy.get('#el').type('supercalifragilisticexpialidocious')\n```\n\n### Date Inputs\n\nUsing `.type()` on a date input (`<input type=\"date\">`) requires specifying a valid date in the format:\n\n*   `yyyy-MM-dd` (e.g. `1999-12-31`)\n\nThis isn't exactly how a user would type into a date input, but is a workaround since date input support varies between browsers and the format varies based on locale. `yyyy-MM-dd` is the format required by [the W3 spec](https://www.w3.org/TR/html/infrastructure.html#dates-and-times) and is what the input's `value` will be set to regardless of browser or locale.\n\n`{upArrow}` and `{downArrow}` can increase and decrease the day value, depending on \"step\" parameter provided. Using `.type()` with `{upArrow}` and `{downArrow}` mimics behavior of `stepUp` and `stepDown` input methods.\n\nSpecial characters (`{leftArrow}`, `{selectAll}`, etc.) are not permitted.\n\n### Month Inputs\n\nUsing `.type()` on a month input (`<input type=\"month\">`) requires specifying a valid month in the format:\n\n*   `yyyy-MM` (e.g. `1999-12`)\n\nThis isn't exactly how a user would type into a month input, but is a workaround since month input support varies between browsers and the format varies based on locale. `yyyy-MM` is the format required by [the W3 spec](https://www.w3.org/TR/html/infrastructure.html#months) and is what the input's `value` will be set to regardless of browser or locale.\n\n`{upArrow}` and `{downArrow}` can increase and decrease the month value, depending on \"step\" parameter provided. Using `.type()` with `{upArrow}` and `{downArrow}` mimics behavior of `stepUp` and `stepDown` input methods.\n\nSpecial characters (`{leftArrow}`, `{selectAll}`, etc.) are not permitted.\n\n### Week Inputs\n\nUsing `.type()` on a week input (`<input type=\"week\">`) requires specifying a valid week in the format:\n\n*   `yyyy-Www` (e.g. `1999-W23`)\n\nWhere `W` is the literal character 'W' and `ww` is the number of the week (01-53).\n\nThis isn't exactly how a user would type into a week input, but is a workaround since week input support varies between browsers and the format varies based on locale. `yyyy-Www` is the format required by [the W3 spec](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-week-string) and is what the input's `value` will be set to regardless of browser or locale.\n\nSpecial characters (`{leftArrow}`, `{selectAll}`, etc.) are not permitted.\n\n`{upArrow}` and `{downArrow}` can increase and decrease the week value, depending on \"step\" parameter provided. Using `.type()` with `{upArrow}` and `{downArrow}` mimics behavior of `stepUp` and `stepDown` input methods.\n\n### Time Inputs\n\nUsing `.type()` on a time input (`<input type=\"time\">`) requires specifying a valid time in the format:\n\n*   `HH:mm` (e.g. `01:30` or `23:15`)\n*   `HH:mm:ss` (e.g. `10:00:30`)\n*   `HH:mm:ss.SSS` (e.g. `12:00:00.384`)\n\nWhere `HH` is 00-23, `mm` is 00-59, `ss` is 00-59, and `SSS` is 000-999.\n\n`{upArrow}` and `{downArrow}` can increase and decrease the seconds value, depending on \"step\" parameter provided. Using `.type()` with `{upArrow}` and `{downArrow}` mimics behavior of `stepUp` and `stepDown` input methods.\n\nSpecial characters (`{leftArrow}`, `{selectAll}`, etc.) are not permitted.\n\n### Key Combinations\n\nWhen using special character sequences, it's possible to activate modifier keys and type key combinations, such as `CTRL+R` or `SHIFT+ALT+b`. Single key combinations can be specified with `{modifier+key}` syntax.\n\nA `keydown` event is fired when a modifier is activated and a `keyup` event is fired when it is released.\n\nYou can also use key combinations during [.click()](/llm/markdown/api/commands/click.md#Click-with-key-combinations), [.rightclick()](/llm/markdown/api/commands/rightclick.md#Right-click-with-key-combinations) and [.dblclick()](/llm/markdown/api/commands/dblclick.md#Double-click-with-key-combinations) through their options. See each doc for more information.\n\n#### Type a key combination\n\n```\n// This is the same as a user holding down SHIFT and ALT, then pressing b// The modifiers are released before typing 'hello'cy.get('input').type('{shift+alt+b}hello')\n```\n\nWhen a modifier is specified on its own, it will remain activated for the duration of the `.type()` command, and is released when all subsequent characters are typed. However, [{release: false}](#Options) can be passed as an [option](#Key-Combinations).\n\n```\n// This is the same as a user holding down SHIFT and ALT, then typing 'hello'// The modifiers are held for the duration of the command.cy.get('input').type('{shift}{alt}hello')\n```\n\n#### Type literal `{` or `}` characters\n\nTo disable parsing special characters sequences, set the `parseSpecialCharSequences` option to `false`.\n\n```\ncy.get('#code-input')  // will not escape { } characters  .type('function (num) {return num * num;}', {    parseSpecialCharSequences: false,  })\n```\n\n#### Hold down modifier key and type a word\n\n```\n// all characters after {ctrl} will have 'ctrlKey'// set to 'true' on their key eventscy.get('input').type('{ctrl}test')\n```\n\n#### Release behavior\n\nBy default, modifiers are released after each type command.\n\n```\n// 'ctrlKey' will be true for each event while 'test' is typed// but false while 'everything' is typedcy.get('input').type('{ctrl}test').type('everything')\n```\n\nTo keep a modifier activated between commands, specify `{release: false}` in the options.\n\n```\n// 'altKey' will be true while typing 'foo'cy.get('input').type('{alt}foo', { release: false })// 'altKey' will also be true during 'get' and 'click' commandscy.get('button').click()\n```\n\nModifiers are automatically released between tests, even with `{release: false}`.\n\n```\nit('has modifiers activated', () => {  // 'altKey' will be true while typing 'foo'  cy.get('input').type('{alt}foo', { release: false })})it('does not have modifiers activated', () => {  // 'altKey' will be false while typing 'bar'  cy.get('input').type('bar')})\n```\n\nTo manually release modifiers within a test after using `{release: false}`, use another `type` command and the modifier will be released after it.\n\n```\n// 'altKey' will be true while typing 'foo'cy.get('input').type('{alt}foo', { release: false })// 'altKey' will be true during the 'get' and 'click' commandscy.get('button').click()// 'altKey' will be released after this commandcy.get('input').type('{alt}')// 'altKey' will be false during the 'get' and 'click' commandscy.get('button').click()\n```\n\n### Global Shortcuts\n\n`.type()` requires a focusable element as the subject, since it's usually intended to type into something that's an input or textarea. Although there _are_ a few cases where it's valid to \"type\" into something other than an input or textarea:\n\n*   Keyboard shortcuts where the listener is on the `document` or `body`.\n*   Holding modifier keys and clicking an arbitrary element.\n\nTo support this, the `body` can be used as the DOM element to type into (even though it's _not_ a focusable element).\n\n#### Use keyboard shortcuts in body\n\n```\n// all of the type events are fired on the bodycy.get('body').type(  '{upArrow}{upArrow}{downArrow}{downArrow}{leftArrow}{rightArrow}{leftArrow}{rightArrow}ba')\n```\n\n#### Do a shift + click\n\n```\n// execute a SHIFT + click on the first <li>// {release: false} is necessary so that// SHIFT will not be released after the type commandcy.get('body').type('{shift}', { release: false }).get('li:first').click()\n```\n\n### Combined Usage with cy.press()\n\nFor comprehensive keyboard testing, combine `.type()` and `.press()`:\n\n#### Form navigation with keyboard\n\n```\nit('navigates form using keyboard only', () => {  cy.get('input[name=\"firstName\"]').type('Marcus')  cy.press(Cypress.Keyboard.Keys.TAB)  cy.get('input[name=\"lastName\"]').should('have.focus').type('Baker')  cy.press(Cypress.Keyboard.Keys.TAB)  cy.get('input[name=\"email\"]').should('have.focus').type('marcus@example.com')  cy.press(Cypress.Keyboard.Keys.ENTER)})\n```\n\n### Options\n\n#### Force typing regardless of its actionable state\n\nForcing typing overrides the [actionable checks](/llm/markdown/app/core-concepts/interacting-with-elements.md#Forcing) Cypress applies and will automatically fire the events.\n\n```\ncy.get('input[type=text]').type('Test all the things', { force: true })\n```\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 1577
    },
    {
      "id": "api/commands/type#input-textarea",
      "doc_id": "api/commands/type",
      "heading": "Input/Textarea",
      "heading_level": 3,
      "content_markdown": "### Input/Textarea\n\n#### Type into a textarea.\n\n```\ncy.get('textarea').type('Hello world') // yields <textarea>\n```\n\n#### Type into a login form\n\n[Check out our example recipe of logging in by typing username and password in HTML web forms](/llm/markdown/app/references/recipes.md#Logging-In)\n\n#### Mimic user typing behavior\n\nEach keypress is delayed 10ms by default in order to simulate how a very fast user types!\n\n```\ncy.get('[contenteditable]').type('some text!')\n```\n\n#### 'Selecting' an option from datalist\n\nFor 'selecting' an option, just type it into the input.\n\n```\n<input list=\"fruit\" /><datalist id=\"fruit\">  <option>Apple</option>  <option>Banana</option>  <option>Cantaloupe</option></datalist>\n```\n\n```\ncy.get('input').type('Apple')\n```\n",
      "section": "api",
      "anchors": [
        "input-textarea"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 121
    },
    {
      "id": "api/commands/type#date-inputs",
      "doc_id": "api/commands/type",
      "heading": "Date Inputs",
      "heading_level": 3,
      "content_markdown": "### Date Inputs\n\nUsing `.type()` on a date input (`<input type=\"date\">`) requires specifying a valid date in the format:\n\n*   `yyyy-MM-dd` (e.g. `1999-12-31`)\n\nThis isn't exactly how a user would type into a date input, but is a workaround since date input support varies between browsers and the format varies based on locale. `yyyy-MM-dd` is the format required by [the W3 spec](https://www.w3.org/TR/html/infrastructure.html#dates-and-times) and is what the input's `value` will be set to regardless of browser or locale.\n\n`{upArrow}` and `{downArrow}` can increase and decrease the day value, depending on \"step\" parameter provided. Using `.type()` with `{upArrow}` and `{downArrow}` mimics behavior of `stepUp` and `stepDown` input methods.\n\nSpecial characters (`{leftArrow}`, `{selectAll}`, etc.) are not permitted.\n",
      "section": "api",
      "anchors": [
        "date-inputs"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 152
    },
    {
      "id": "api/commands/type#month-inputs",
      "doc_id": "api/commands/type",
      "heading": "Month Inputs",
      "heading_level": 3,
      "content_markdown": "### Month Inputs\n\nUsing `.type()` on a month input (`<input type=\"month\">`) requires specifying a valid month in the format:\n\n*   `yyyy-MM` (e.g. `1999-12`)\n\nThis isn't exactly how a user would type into a month input, but is a workaround since month input support varies between browsers and the format varies based on locale. `yyyy-MM` is the format required by [the W3 spec](https://www.w3.org/TR/html/infrastructure.html#months) and is what the input's `value` will be set to regardless of browser or locale.\n\n`{upArrow}` and `{downArrow}` can increase and decrease the month value, depending on \"step\" parameter provided. Using `.type()` with `{upArrow}` and `{downArrow}` mimics behavior of `stepUp` and `stepDown` input methods.\n\nSpecial characters (`{leftArrow}`, `{selectAll}`, etc.) are not permitted.\n",
      "section": "api",
      "anchors": [
        "month-inputs"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 152
    },
    {
      "id": "api/commands/type#week-inputs",
      "doc_id": "api/commands/type",
      "heading": "Week Inputs",
      "heading_level": 3,
      "content_markdown": "### Week Inputs\n\nUsing `.type()` on a week input (`<input type=\"week\">`) requires specifying a valid week in the format:\n\n*   `yyyy-Www` (e.g. `1999-W23`)\n\nWhere `W` is the literal character 'W' and `ww` is the number of the week (01-53).\n\nThis isn't exactly how a user would type into a week input, but is a workaround since week input support varies between browsers and the format varies based on locale. `yyyy-Www` is the format required by [the W3 spec](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-week-string) and is what the input's `value` will be set to regardless of browser or locale.\n\nSpecial characters (`{leftArrow}`, `{selectAll}`, etc.) are not permitted.\n\n`{upArrow}` and `{downArrow}` can increase and decrease the week value, depending on \"step\" parameter provided. Using `.type()` with `{upArrow}` and `{downArrow}` mimics behavior of `stepUp` and `stepDown` input methods.\n",
      "section": "api",
      "anchors": [
        "week-inputs"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 173
    },
    {
      "id": "api/commands/type#time-inputs",
      "doc_id": "api/commands/type",
      "heading": "Time Inputs",
      "heading_level": 3,
      "content_markdown": "### Time Inputs\n\nUsing `.type()` on a time input (`<input type=\"time\">`) requires specifying a valid time in the format:\n\n*   `HH:mm` (e.g. `01:30` or `23:15`)\n*   `HH:mm:ss` (e.g. `10:00:30`)\n*   `HH:mm:ss.SSS` (e.g. `12:00:00.384`)\n\nWhere `HH` is 00-23, `mm` is 00-59, `ss` is 00-59, and `SSS` is 000-999.\n\n`{upArrow}` and `{downArrow}` can increase and decrease the seconds value, depending on \"step\" parameter provided. Using `.type()` with `{upArrow}` and `{downArrow}` mimics behavior of `stepUp` and `stepDown` input methods.\n\nSpecial characters (`{leftArrow}`, `{selectAll}`, etc.) are not permitted.\n",
      "section": "api",
      "anchors": [
        "time-inputs"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 112
    },
    {
      "id": "api/commands/type#key-combinations",
      "doc_id": "api/commands/type",
      "heading": "Key Combinations",
      "heading_level": 3,
      "content_markdown": "### Key Combinations\n\nWhen using special character sequences, it's possible to activate modifier keys and type key combinations, such as `CTRL+R` or `SHIFT+ALT+b`. Single key combinations can be specified with `{modifier+key}` syntax.\n\nA `keydown` event is fired when a modifier is activated and a `keyup` event is fired when it is released.\n\nYou can also use key combinations during [.click()](/llm/markdown/api/commands/click.md#Click-with-key-combinations), [.rightclick()](/llm/markdown/api/commands/rightclick.md#Right-click-with-key-combinations) and [.dblclick()](/llm/markdown/api/commands/dblclick.md#Double-click-with-key-combinations) through their options. See each doc for more information.\n\n#### Type a key combination\n\n```\n// This is the same as a user holding down SHIFT and ALT, then pressing b// The modifiers are released before typing 'hello'cy.get('input').type('{shift+alt+b}hello')\n```\n\nWhen a modifier is specified on its own, it will remain activated for the duration of the `.type()` command, and is released when all subsequent characters are typed. However, [{release: false}](#Options) can be passed as an [option](#Key-Combinations).\n\n```\n// This is the same as a user holding down SHIFT and ALT, then typing 'hello'// The modifiers are held for the duration of the command.cy.get('input').type('{shift}{alt}hello')\n```\n\n#### Type literal `{` or `}` characters\n\nTo disable parsing special characters sequences, set the `parseSpecialCharSequences` option to `false`.\n\n```\ncy.get('#code-input')  // will not escape { } characters  .type('function (num) {return num * num;}', {    parseSpecialCharSequences: false,  })\n```\n\n#### Hold down modifier key and type a word\n\n```\n// all characters after {ctrl} will have 'ctrlKey'// set to 'true' on their key eventscy.get('input').type('{ctrl}test')\n```\n\n#### Release behavior\n\nBy default, modifiers are released after each type command.\n\n```\n// 'ctrlKey' will be true for each event while 'test' is typed// but false while 'everything' is typedcy.get('input').type('{ctrl}test').type('everything')\n```\n\nTo keep a modifier activated between commands, specify `{release: false}` in the options.\n\n```\n// 'altKey' will be true while typing 'foo'cy.get('input').type('{alt}foo', { release: false })// 'altKey' will also be true during 'get' and 'click' commandscy.get('button').click()\n```\n\nModifiers are automatically released between tests, even with `{release: false}`.\n\n```\nit('has modifiers activated', () => {  // 'altKey' will be true while typing 'foo'  cy.get('input').type('{alt}foo', { release: false })})it('does not have modifiers activated', () => {  // 'altKey' will be false while typing 'bar'  cy.get('input').type('bar')})\n```\n\nTo manually release modifiers within a test after using `{release: false}`, use another `type` command and the modifier will be released after it.\n\n```\n// 'altKey' will be true while typing 'foo'cy.get('input').type('{alt}foo', { release: false })// 'altKey' will be true during the 'get' and 'click' commandscy.get('button').click()// 'altKey' will be released after this commandcy.get('input').type('{alt}')// 'altKey' will be false during the 'get' and 'click' commandscy.get('button').click()\n```\n",
      "section": "api",
      "anchors": [
        "key-combinations"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 549
    },
    {
      "id": "api/commands/type#type-a-key-combination",
      "doc_id": "api/commands/type",
      "heading": "Type a key combination",
      "heading_level": 4,
      "content_markdown": "#### Type a key combination\n\n```\n// This is the same as a user holding down SHIFT and ALT, then pressing b// The modifiers are released before typing 'hello'cy.get('input').type('{shift+alt+b}hello')\n```\n\nWhen a modifier is specified on its own, it will remain activated for the duration of the `.type()` command, and is released when all subsequent characters are typed. However, [{release: false}](#Options) can be passed as an [option](#Key-Combinations).\n\n```\n// This is the same as a user holding down SHIFT and ALT, then typing 'hello'// The modifiers are held for the duration of the command.cy.get('input').type('{shift}{alt}hello')\n```\n",
      "section": "api",
      "anchors": [
        "type-a-key-combination"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 127
    },
    {
      "id": "api/commands/type#type-literal-or-characters",
      "doc_id": "api/commands/type",
      "heading": "Type literal { or } characters",
      "heading_level": 4,
      "content_markdown": "#### Type literal `{` or `}` characters\n\nTo disable parsing special characters sequences, set the `parseSpecialCharSequences` option to `false`.\n\n```\ncy.get('#code-input')  // will not escape { } characters  .type('function (num) {return num * num;}', {    parseSpecialCharSequences: false,  })\n```\n",
      "section": "api",
      "anchors": [
        "type-literal-or-characters"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 52
    },
    {
      "id": "api/commands/type#release-behavior",
      "doc_id": "api/commands/type",
      "heading": "Release behavior",
      "heading_level": 4,
      "content_markdown": "#### Release behavior\n\nBy default, modifiers are released after each type command.\n\n```\n// 'ctrlKey' will be true for each event while 'test' is typed// but false while 'everything' is typedcy.get('input').type('{ctrl}test').type('everything')\n```\n\nTo keep a modifier activated between commands, specify `{release: false}` in the options.\n\n```\n// 'altKey' will be true while typing 'foo'cy.get('input').type('{alt}foo', { release: false })// 'altKey' will also be true during 'get' and 'click' commandscy.get('button').click()\n```\n\nModifiers are automatically released between tests, even with `{release: false}`.\n\n```\nit('has modifiers activated', () => {  // 'altKey' will be true while typing 'foo'  cy.get('input').type('{alt}foo', { release: false })})it('does not have modifiers activated', () => {  // 'altKey' will be false while typing 'bar'  cy.get('input').type('bar')})\n```\n\nTo manually release modifiers within a test after using `{release: false}`, use another `type` command and the modifier will be released after it.\n\n```\n// 'altKey' will be true while typing 'foo'cy.get('input').type('{alt}foo', { release: false })// 'altKey' will be true during the 'get' and 'click' commandscy.get('button').click()// 'altKey' will be released after this commandcy.get('input').type('{alt}')// 'altKey' will be false during the 'get' and 'click' commandscy.get('button').click()\n```\n",
      "section": "api",
      "anchors": [
        "release-behavior"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 240
    },
    {
      "id": "api/commands/type#global-shortcuts",
      "doc_id": "api/commands/type",
      "heading": "Global Shortcuts",
      "heading_level": 3,
      "content_markdown": "### Global Shortcuts\n\n`.type()` requires a focusable element as the subject, since it's usually intended to type into something that's an input or textarea. Although there _are_ a few cases where it's valid to \"type\" into something other than an input or textarea:\n\n*   Keyboard shortcuts where the listener is on the `document` or `body`.\n*   Holding modifier keys and clicking an arbitrary element.\n\nTo support this, the `body` can be used as the DOM element to type into (even though it's _not_ a focusable element).\n\n#### Use keyboard shortcuts in body\n\n```\n// all of the type events are fired on the bodycy.get('body').type(  '{upArrow}{upArrow}{downArrow}{downArrow}{leftArrow}{rightArrow}{leftArrow}{rightArrow}ba')\n```\n\n#### Do a shift + click\n\n```\n// execute a SHIFT + click on the first <li>// {release: false} is necessary so that// SHIFT will not be released after the type commandcy.get('body').type('{shift}', { release: false }).get('li:first').click()\n```\n",
      "section": "api",
      "anchors": [
        "global-shortcuts"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 191
    },
    {
      "id": "api/commands/type#do-a-shift-click",
      "doc_id": "api/commands/type",
      "heading": "Do a shift + click",
      "heading_level": 4,
      "content_markdown": "#### Do a shift + click\n\n```\n// execute a SHIFT + click on the first <li>// {release: false} is necessary so that// SHIFT will not be released after the type commandcy.get('body').type('{shift}', { release: false }).get('li:first').click()\n```\n",
      "section": "api",
      "anchors": [
        "do-a-shift-click"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 49
    },
    {
      "id": "api/commands/type#combined-usage-with-cy-press",
      "doc_id": "api/commands/type",
      "heading": "Combined Usage with cy.press()",
      "heading_level": 3,
      "content_markdown": "### Combined Usage with cy.press()\n\nFor comprehensive keyboard testing, combine `.type()` and `.press()`:\n\n#### Form navigation with keyboard\n\n```\nit('navigates form using keyboard only', () => {  cy.get('input[name=\"firstName\"]').type('Marcus')  cy.press(Cypress.Keyboard.Keys.TAB)  cy.get('input[name=\"lastName\"]').should('have.focus').type('Baker')  cy.press(Cypress.Keyboard.Keys.TAB)  cy.get('input[name=\"email\"]').should('have.focus').type('marcus@example.com')  cy.press(Cypress.Keyboard.Keys.ENTER)})\n```\n",
      "section": "api",
      "anchors": [
        "combined-usage-with-cy-press"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 45
    },
    {
      "id": "api/commands/type#options",
      "doc_id": "api/commands/type",
      "heading": "Options",
      "heading_level": 3,
      "content_markdown": "### Options\n\n#### Force typing regardless of its actionable state\n\nForcing typing overrides the [actionable checks](/llm/markdown/app/core-concepts/interacting-with-elements.md#Forcing) Cypress applies and will automatically fire the events.\n\n```\ncy.get('input[type=text]').type('Test all the things', { force: true })\n```\n",
      "section": "api",
      "anchors": [
        "options"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 45
    },
    {
      "id": "api/commands/type#force-typing-regardless-of-its-actionable-state",
      "doc_id": "api/commands/type",
      "heading": "Force typing regardless of its actionable state",
      "heading_level": 4,
      "content_markdown": "#### Force typing regardless of its actionable state\n\nForcing typing overrides the [actionable checks](/llm/markdown/app/core-concepts/interacting-with-elements.md#Forcing) Cypress applies and will automatically fire the events.\n\n```\ncy.get('input[type=text]').type('Test all the things', { force: true })\n```\n",
      "section": "api",
      "anchors": [
        "force-typing-regardless-of-its-actionable-state"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 43
    },
    {
      "id": "api/commands/type#notes",
      "doc_id": "api/commands/type",
      "heading": "Notes",
      "heading_level": 2,
      "content_markdown": "## Notes\n\n### Supported Elements\n\n*   ^HTML `<body>` and `<textarea>` elements.\n*   Elements with a defined `tabindex` attribute.\n*   Elements with a defined `contenteditable` attribute.\n*   ^HTML `<input>` elements with a defined `type` attribute of one of the following:\n    *   `text`\n    *   `password`\n    *   `email`\n    *   `number`\n    *   `date`\n    *   `week`\n    *   `month`\n    *   `time`\n    *   `datetime-local`\n    *   `search`\n    *   `url`\n    *   `tel`\n\n### Actionability\n\n`.type()` is an \"action command\" that follows all the rules of [Actionability](/llm/markdown/app/core-concepts/interacting-with-elements.md).\n\n### Events\n\n#### When element is not in focus\n\nIf the element is currently not in focus, before issuing any keystrokes Cypress will first issue a [`.click()`](/llm/markdown/api/commands/click.md) to the element to bring it into focus.\n\n#### Events that fire\n\nOnce the element is in focus, Cypress will begin firing keyboard events.\n\nThe following events will be fired based on what key was pressed identical to the event spec:\n\n*   `keydown`\n*   `keypress`\n*   `beforeinput`\n*   `textInput`\n*   `input`\n*   `keyup`\n\nAdditionally `change` events will be fired either when the `{enter}` key is pressed (and the value has changed since the last focus event), or whenever the element loses focus. This matches browser behavior.\n\nEvents that should not fire on non input types such as elements with `tabindex` do not fire their `textInput` or `input` events. Only typing into elements which cause the actual value or text to change will fire those events.\n\n#### Event Firing\n\nThe following rules have been implemented that match real browser behavior (and the spec):\n\n1.  Cypress respects not firing subsequent events if previous ones were canceled.\n2.  Cypress will fire `keypress` _only_ if that key is supposed to actually fire `keypress`.\n3.  Cypress will fire `textInput` _only_ if typing that key would have inserted an actual character.\n4.  Cypress will fire `input` _only_ if typing that key modifies or changes the value of the element.\n\n#### Event Cancellation\n\nCypress respects all default browser behavior when events are canceled.\n\n```\n// prevent the characters from being inserted// by canceling keydown, keypress, or textInput$('#username').on('keydown', (e) => {  e.preventDefault()})// Cypress will not insert any characters if keydown, keypress, or textInput// are cancelled - which matches the default browser behaviorcy.get('#username').type('bob@gmail.com').should('have.value', '') // true\n```\n\n#### Preventing `mousedown` does not prevent typing\n\nIn a real browser, preventing `mousedown` on a form field will prevent it from receiving focus and thus prevent it from being able to be typed into. Currently, Cypress does not factor this in. [open an issue](https://github.com/cypress-io/cypress/issues/new/choose) if you need this to be fixed.\n\n#### Key Events Table\n\nCypress prints out a table of key events that detail the keys that were pressed when clicking on type within the [Command Log](#Command-Log). Each character will contain the `which` character code and the events that happened as a result of that key press.\n\nEvents that were `defaultPrevented` may prevent other events from firing and those will show up as empty. For instance, canceling `keydown` will not fire `keypress` or `textInput` or `input`, but will fire `keyup` (which matches the spec).\n\nAdditionally, events that cause a `change` event to fire (such as typing `{enter}`) will display with the `change` event column as `true`.\n\nAny modifiers activated for the event are also listed in a `modifiers` column.\n\n### When to use cy.press()\n\nWhile `.type()` is excellent for typing text content, use [`cy.press()`](/llm/markdown/api/commands/press.md) for:\n\n*   **Navigation keys**: `Tab`, `Arrow` keys, `Enter`, `Escape`\n*   **Accessibility testing**: Focus management and keyboard navigation\n*   **Single key events**: When you need native keyboard events rather than simulated ones\n*   **Keys not supported by .type()**: Such as `{tab}`\n\n```\n// Use .type() for text inputcy.get('input').type('Hello World')// Use .press() for navigation and special keyscy.press(Cypress.Keyboard.Keys.TAB)cy.press(Cypress.Keyboard.Keys.ENTER)\n```\n\n**Combining .type() and .press()**: You can use both commands together for comprehensive keyboard testing:\n\n```\n// Type text contentcy.get('input.email').type('user@example.com')// Navigate with keyboardcy.press(Cypress.Keyboard.Keys.TAB)cy.get('input.password').type('password123')// Submit with keyboardcy.press(Cypress.Keyboard.Keys.ENTER)\n```\n\n### Modifiers\n\n#### Modifier effects\n\nIn a real browser, if a user holds `SHIFT` and types `a`, a capital `A` will be typed into the input. Currently, Cypress does not simulate that behavior.\n\nModifiers are simulated by setting their corresponding values to `true` for key and click events. So, for example, activating the `{shift}` modifier will set `event.shiftKey` to true for any key events, such as `keydown`.\n\n```\n// app codedocument.querySelector('input:first').addEventListener('keydown', (e) => {  // e.shiftKey will be true})// in testcy.get('input:first').type('{shift}a')\n```\n\nIn the example above, a lowercase `a` will be typed, because that's the literal character specified. To type a capital `A`, you can use `.type('{shift}A')` (or `.type('A')` if you don't care about the `shiftKey` property on any key events).\n\nThis holds true for other special key combinations as well (that may be OS-specific). For example, on OSX, typing `ALT + SHIFT + K` creates the special character ``. Like with capitalization, `.type()` will not output ``, but the letter `k`.\n\nSimilarly, modifiers will not affect arrow keys or deletion keys. For example `{ctrl}{backspace}` will not delete an entire word. [open an issue](https://github.com/cypress-io/cypress/issues/new) if you need modifier effects to be implemented.\n\n### Form Submission\n\n#### Implicit form submission behavior\n\nCypress automatically matches the spec and browser behavior for pressing the `{enter}` key when the input belongs to a `<form>`.\n\nThis behavior is defined here: [Form Implicit Submission](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission).\n\nFor instance the following will submit the form.\n\n```\n<form action=\"/login\">  <input id=\"username\" />  <input id=\"password\" />  <button type=\"submit\">Log In</button></form>\n```\n\n```\ncy.get('#username').type('bob@burgers.com')cy.get('#password').type('password123{enter}')\n```\n\nBecause there are multiple `inputs` and one `submit` button, Cypress submits the form (and fires submit events) as well as a synthetic `click` event to the `button`.\n\nThe spec defines the \"submit\" button as the first `input[type=submit]` or `button[type!=button]` from the form.\n\nAdditionally Cypress handles these 4 other situations as defined in the spec:\n\n1.  Does not submit a form if there are multiple inputs and no `submit` button.\n2.  Does not submit a form if the `submit` button is disabled.\n3.  Submits a form, but does not fire synthetic `click` event, if there is 1 `input` and no `submit` button\n4.  Submits form and fires a synthetic `click` event to the `submit` when it exists.\n\nIf the form's `submit` event is `preventedDefault` the form will not actually be submitted.\n",
      "section": "api",
      "anchors": [
        "notes"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 1348
    },
    {
      "id": "api/commands/type#supported-elements",
      "doc_id": "api/commands/type",
      "heading": "Supported Elements",
      "heading_level": 3,
      "content_markdown": "### Supported Elements\n\n*   ^HTML `<body>` and `<textarea>` elements.\n*   Elements with a defined `tabindex` attribute.\n*   Elements with a defined `contenteditable` attribute.\n*   ^HTML `<input>` elements with a defined `type` attribute of one of the following:\n    *   `text`\n    *   `password`\n    *   `email`\n    *   `number`\n    *   `date`\n    *   `week`\n    *   `month`\n    *   `time`\n    *   `datetime-local`\n    *   `search`\n    *   `url`\n    *   `tel`\n",
      "section": "api",
      "anchors": [
        "supported-elements"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 81
    },
    {
      "id": "api/commands/type#events",
      "doc_id": "api/commands/type",
      "heading": "Events",
      "heading_level": 3,
      "content_markdown": "### Events\n\n#### When element is not in focus\n\nIf the element is currently not in focus, before issuing any keystrokes Cypress will first issue a [`.click()`](/llm/markdown/api/commands/click.md) to the element to bring it into focus.\n\n#### Events that fire\n\nOnce the element is in focus, Cypress will begin firing keyboard events.\n\nThe following events will be fired based on what key was pressed identical to the event spec:\n\n*   `keydown`\n*   `keypress`\n*   `beforeinput`\n*   `textInput`\n*   `input`\n*   `keyup`\n\nAdditionally `change` events will be fired either when the `{enter}` key is pressed (and the value has changed since the last focus event), or whenever the element loses focus. This matches browser behavior.\n\nEvents that should not fire on non input types such as elements with `tabindex` do not fire their `textInput` or `input` events. Only typing into elements which cause the actual value or text to change will fire those events.\n\n#### Event Firing\n\nThe following rules have been implemented that match real browser behavior (and the spec):\n\n1.  Cypress respects not firing subsequent events if previous ones were canceled.\n2.  Cypress will fire `keypress` _only_ if that key is supposed to actually fire `keypress`.\n3.  Cypress will fire `textInput` _only_ if typing that key would have inserted an actual character.\n4.  Cypress will fire `input` _only_ if typing that key modifies or changes the value of the element.\n\n#### Event Cancellation\n\nCypress respects all default browser behavior when events are canceled.\n\n```\n// prevent the characters from being inserted// by canceling keydown, keypress, or textInput$('#username').on('keydown', (e) => {  e.preventDefault()})// Cypress will not insert any characters if keydown, keypress, or textInput// are cancelled - which matches the default browser behaviorcy.get('#username').type('bob@gmail.com').should('have.value', '') // true\n```\n\n#### Preventing `mousedown` does not prevent typing\n\nIn a real browser, preventing `mousedown` on a form field will prevent it from receiving focus and thus prevent it from being able to be typed into. Currently, Cypress does not factor this in. [open an issue](https://github.com/cypress-io/cypress/issues/new/choose) if you need this to be fixed.\n\n#### Key Events Table\n\nCypress prints out a table of key events that detail the keys that were pressed when clicking on type within the [Command Log](#Command-Log). Each character will contain the `which` character code and the events that happened as a result of that key press.\n\nEvents that were `defaultPrevented` may prevent other events from firing and those will show up as empty. For instance, canceling `keydown` will not fire `keypress` or `textInput` or `input`, but will fire `keyup` (which matches the spec).\n\nAdditionally, events that cause a `change` event to fire (such as typing `{enter}`) will display with the `change` event column as `true`.\n\nAny modifiers activated for the event are also listed in a `modifiers` column.\n",
      "section": "api",
      "anchors": [
        "events"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 607
    },
    {
      "id": "api/commands/type#when-element-is-not-in-focus",
      "doc_id": "api/commands/type",
      "heading": "When element is not in focus",
      "heading_level": 4,
      "content_markdown": "#### When element is not in focus\n\nIf the element is currently not in focus, before issuing any keystrokes Cypress will first issue a [`.click()`](/llm/markdown/api/commands/click.md) to the element to bring it into focus.\n",
      "section": "api",
      "anchors": [
        "when-element-is-not-in-focus"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 44
    },
    {
      "id": "api/commands/type#events-that-fire",
      "doc_id": "api/commands/type",
      "heading": "Events that fire",
      "heading_level": 4,
      "content_markdown": "#### Events that fire\n\nOnce the element is in focus, Cypress will begin firing keyboard events.\n\nThe following events will be fired based on what key was pressed identical to the event spec:\n\n*   `keydown`\n*   `keypress`\n*   `beforeinput`\n*   `textInput`\n*   `input`\n*   `keyup`\n\nAdditionally `change` events will be fired either when the `{enter}` key is pressed (and the value has changed since the last focus event), or whenever the element loses focus. This matches browser behavior.\n\nEvents that should not fire on non input types such as elements with `tabindex` do not fire their `textInput` or `input` events. Only typing into elements which cause the actual value or text to change will fire those events.\n",
      "section": "api",
      "anchors": [
        "events-that-fire"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 156
    },
    {
      "id": "api/commands/type#event-firing",
      "doc_id": "api/commands/type",
      "heading": "Event Firing",
      "heading_level": 4,
      "content_markdown": "#### Event Firing\n\nThe following rules have been implemented that match real browser behavior (and the spec):\n\n1.  Cypress respects not firing subsequent events if previous ones were canceled.\n2.  Cypress will fire `keypress` _only_ if that key is supposed to actually fire `keypress`.\n3.  Cypress will fire `textInput` _only_ if typing that key would have inserted an actual character.\n4.  Cypress will fire `input` _only_ if typing that key modifies or changes the value of the element.\n",
      "section": "api",
      "anchors": [
        "event-firing"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 104
    },
    {
      "id": "api/commands/type#event-cancellation",
      "doc_id": "api/commands/type",
      "heading": "Event Cancellation",
      "heading_level": 4,
      "content_markdown": "#### Event Cancellation\n\nCypress respects all default browser behavior when events are canceled.\n\n```\n// prevent the characters from being inserted// by canceling keydown, keypress, or textInput$('#username').on('keydown', (e) => {  e.preventDefault()})// Cypress will not insert any characters if keydown, keypress, or textInput// are cancelled - which matches the default browser behaviorcy.get('#username').type('bob@gmail.com').should('have.value', '') // true\n```\n",
      "section": "api",
      "anchors": [
        "event-cancellation"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 73
    },
    {
      "id": "api/commands/type#preventing-mousedown-does-not-prevent-typing",
      "doc_id": "api/commands/type",
      "heading": "Preventing mousedown does not prevent typing",
      "heading_level": 4,
      "content_markdown": "#### Preventing `mousedown` does not prevent typing\n\nIn a real browser, preventing `mousedown` on a form field will prevent it from receiving focus and thus prevent it from being able to be typed into. Currently, Cypress does not factor this in. [open an issue](https://github.com/cypress-io/cypress/issues/new/choose) if you need this to be fixed.\n",
      "section": "api",
      "anchors": [
        "preventing-mousedown-does-not-prevent-typing"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 68
    },
    {
      "id": "api/commands/type#key-events-table",
      "doc_id": "api/commands/type",
      "heading": "Key Events Table",
      "heading_level": 4,
      "content_markdown": "#### Key Events Table\n\nCypress prints out a table of key events that detail the keys that were pressed when clicking on type within the [Command Log](#Command-Log). Each character will contain the `which` character code and the events that happened as a result of that key press.\n\nEvents that were `defaultPrevented` may prevent other events from firing and those will show up as empty. For instance, canceling `keydown` will not fire `keypress` or `textInput` or `input`, but will fire `keyup` (which matches the spec).\n\nAdditionally, events that cause a `change` event to fire (such as typing `{enter}`) will display with the `change` event column as `true`.\n\nAny modifiers activated for the event are also listed in a `modifiers` column.\n",
      "section": "api",
      "anchors": [
        "key-events-table"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 159
    },
    {
      "id": "api/commands/type#when-to-use-cy-press",
      "doc_id": "api/commands/type",
      "heading": "When to use cy.press()",
      "heading_level": 3,
      "content_markdown": "### When to use cy.press()\n\nWhile `.type()` is excellent for typing text content, use [`cy.press()`](/llm/markdown/api/commands/press.md) for:\n\n*   **Navigation keys**: `Tab`, `Arrow` keys, `Enter`, `Escape`\n*   **Accessibility testing**: Focus management and keyboard navigation\n*   **Single key events**: When you need native keyboard events rather than simulated ones\n*   **Keys not supported by .type()**: Such as `{tab}`\n\n```\n// Use .type() for text inputcy.get('input').type('Hello World')// Use .press() for navigation and special keyscy.press(Cypress.Keyboard.Keys.TAB)cy.press(Cypress.Keyboard.Keys.ENTER)\n```\n\n**Combining .type() and .press()**: You can use both commands together for comprehensive keyboard testing:\n\n```\n// Type text contentcy.get('input.email').type('user@example.com')// Navigate with keyboardcy.press(Cypress.Keyboard.Keys.TAB)cy.get('input.password').type('password123')// Submit with keyboardcy.press(Cypress.Keyboard.Keys.ENTER)\n```\n",
      "section": "api",
      "anchors": [
        "when-to-use-cy-press"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 129
    },
    {
      "id": "api/commands/type#modifiers",
      "doc_id": "api/commands/type",
      "heading": "Modifiers",
      "heading_level": 3,
      "content_markdown": "### Modifiers\n\n#### Modifier effects\n\nIn a real browser, if a user holds `SHIFT` and types `a`, a capital `A` will be typed into the input. Currently, Cypress does not simulate that behavior.\n\nModifiers are simulated by setting their corresponding values to `true` for key and click events. So, for example, activating the `{shift}` modifier will set `event.shiftKey` to true for any key events, such as `keydown`.\n\n```\n// app codedocument.querySelector('input:first').addEventListener('keydown', (e) => {  // e.shiftKey will be true})// in testcy.get('input:first').type('{shift}a')\n```\n\nIn the example above, a lowercase `a` will be typed, because that's the literal character specified. To type a capital `A`, you can use `.type('{shift}A')` (or `.type('A')` if you don't care about the `shiftKey` property on any key events).\n\nThis holds true for other special key combinations as well (that may be OS-specific). For example, on OSX, typing `ALT + SHIFT + K` creates the special character ``. Like with capitalization, `.type()` will not output ``, but the letter `k`.\n\nSimilarly, modifiers will not affect arrow keys or deletion keys. For example `{ctrl}{backspace}` will not delete an entire word. [open an issue](https://github.com/cypress-io/cypress/issues/new) if you need modifier effects to be implemented.\n",
      "section": "api",
      "anchors": [
        "modifiers"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 256
    },
    {
      "id": "api/commands/type#modifier-effects",
      "doc_id": "api/commands/type",
      "heading": "Modifier effects",
      "heading_level": 4,
      "content_markdown": "#### Modifier effects\n\nIn a real browser, if a user holds `SHIFT` and types `a`, a capital `A` will be typed into the input. Currently, Cypress does not simulate that behavior.\n\nModifiers are simulated by setting their corresponding values to `true` for key and click events. So, for example, activating the `{shift}` modifier will set `event.shiftKey` to true for any key events, such as `keydown`.\n\n```\n// app codedocument.querySelector('input:first').addEventListener('keydown', (e) => {  // e.shiftKey will be true})// in testcy.get('input:first').type('{shift}a')\n```\n\nIn the example above, a lowercase `a` will be typed, because that's the literal character specified. To type a capital `A`, you can use `.type('{shift}A')` (or `.type('A')` if you don't care about the `shiftKey` property on any key events).\n\nThis holds true for other special key combinations as well (that may be OS-specific). For example, on OSX, typing `ALT + SHIFT + K` creates the special character ``. Like with capitalization, `.type()` will not output ``, but the letter `k`.\n\nSimilarly, modifiers will not affect arrow keys or deletion keys. For example `{ctrl}{backspace}` will not delete an entire word. [open an issue](https://github.com/cypress-io/cypress/issues/new) if you need modifier effects to be implemented.\n",
      "section": "api",
      "anchors": [
        "modifier-effects"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 253
    },
    {
      "id": "api/commands/type#form-submission",
      "doc_id": "api/commands/type",
      "heading": "Form Submission",
      "heading_level": 3,
      "content_markdown": "### Form Submission\n\n#### Implicit form submission behavior\n\nCypress automatically matches the spec and browser behavior for pressing the `{enter}` key when the input belongs to a `<form>`.\n\nThis behavior is defined here: [Form Implicit Submission](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission).\n\nFor instance the following will submit the form.\n\n```\n<form action=\"/login\">  <input id=\"username\" />  <input id=\"password\" />  <button type=\"submit\">Log In</button></form>\n```\n\n```\ncy.get('#username').type('bob@burgers.com')cy.get('#password').type('password123{enter}')\n```\n\nBecause there are multiple `inputs` and one `submit` button, Cypress submits the form (and fires submit events) as well as a synthetic `click` event to the `button`.\n\nThe spec defines the \"submit\" button as the first `input[type=submit]` or `button[type!=button]` from the form.\n\nAdditionally Cypress handles these 4 other situations as defined in the spec:\n\n1.  Does not submit a form if there are multiple inputs and no `submit` button.\n2.  Does not submit a form if the `submit` button is disabled.\n3.  Submits a form, but does not fire synthetic `click` event, if there is 1 `input` and no `submit` button\n4.  Submits form and fires a synthetic `click` event to the `submit` when it exists.\n\nIf the form's `submit` event is `preventedDefault` the form will not actually be submitted.\n",
      "section": "api",
      "anchors": [
        "form-submission"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 253
    },
    {
      "id": "api/commands/type#implicit-form-submission-behavior",
      "doc_id": "api/commands/type",
      "heading": "Implicit form submission behavior",
      "heading_level": 4,
      "content_markdown": "#### Implicit form submission behavior\n\nCypress automatically matches the spec and browser behavior for pressing the `{enter}` key when the input belongs to a `<form>`.\n\nThis behavior is defined here: [Form Implicit Submission](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission).\n\nFor instance the following will submit the form.\n\n```\n<form action=\"/login\">  <input id=\"username\" />  <input id=\"password\" />  <button type=\"submit\">Log In</button></form>\n```\n\n```\ncy.get('#username').type('bob@burgers.com')cy.get('#password').type('password123{enter}')\n```\n\nBecause there are multiple `inputs` and one `submit` button, Cypress submits the form (and fires submit events) as well as a synthetic `click` event to the `button`.\n\nThe spec defines the \"submit\" button as the first `input[type=submit]` or `button[type!=button]` from the form.\n\nAdditionally Cypress handles these 4 other situations as defined in the spec:\n\n1.  Does not submit a form if there are multiple inputs and no `submit` button.\n2.  Does not submit a form if the `submit` button is disabled.\n3.  Submits a form, but does not fire synthetic `click` event, if there is 1 `input` and no `submit` button\n4.  Submits form and fires a synthetic `click` event to the `submit` when it exists.\n\nIf the form's `submit` event is `preventedDefault` the form will not actually be submitted.\n",
      "section": "api",
      "anchors": [
        "implicit-form-submission-behavior"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 249
    },
    {
      "id": "api/commands/type#rules",
      "doc_id": "api/commands/type",
      "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*   `.type()` 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*   `.type()` will automatically wait for the element to reach an [actionable state](/llm/markdown/app/core-concepts/interacting-with-elements.md).\n*   `.type()` 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*   `.type()` can time out waiting for the element to reach an [actionable state](/llm/markdown/app/core-concepts/interacting-with-elements.md).\n*   `.type()` can time out waiting for assertions you've added to pass.\n",
      "section": "api",
      "anchors": [
        "rules"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 107
    },
    {
      "id": "api/commands/type#timeouts-learn-about-timeouts",
      "doc_id": "api/commands/type",
      "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*   `.type()` can time out waiting for the element to reach an [actionable state](/llm/markdown/app/core-concepts/interacting-with-elements.md).\n*   `.type()` 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/type.json",
      "token_estimate": 41
    },
    {
      "id": "api/commands/type#command-log",
      "doc_id": "api/commands/type",
      "heading": "Command Log",
      "heading_level": 2,
      "content_markdown": "## Command Log\n\n**_Type into the input_**\n\n```\ncy.get('input[name=firstName]').type('Jane Lane')\n```\n\nThe commands above will display in the Command Log as:\n\nWhen clicking on `type` within the command log, the console outputs the following:\n",
      "section": "api",
      "anchors": [
        "command-log"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 45
    },
    {
      "id": "api/commands/type#history",
      "doc_id": "api/commands/type",
      "heading": "History",
      "heading_level": 2,
      "content_markdown": "## History\n\n| Version | Changes |\n| --- | --- |\n| [13.14.0](/llm/markdown/app/references/changelog.md#13-14-0) | Added support for `.type({upArrow})` and `.type({downArrow})` to work on date, month, week, time, datetime-local and range input types |\n| [6.1.0](/llm/markdown/app/references/changelog.md#6-1-0) | Added option `scrollBehavior` |\n| [5.6.0](/llm/markdown/app/references/changelog.md#5-6-0) | Support single key combination syntax |\n| [5.5.0](/llm/markdown/app/references/changelog.md#5-5-0) | Support `beforeinput` event |\n| [3.4.1](/llm/markdown/app/references/changelog.md#3-4-1) | Added `parseSpecialCharSequences` option |\n| [3.3.0](/llm/markdown/app/references/changelog.md#3-3-0) | Added `{insert}`, `{pageup}` and `{pagedown}` character sequences |\n| [3.2.0](/llm/markdown/app/references/changelog.md#3-2-0) | Added `{home}` and `{end}` character sequences |\n| [0.20.0](/llm/markdown/app/references/changelog.md#0-20-0) | Supports for typing in inputs of type `date`, `time`, `month`, and `week` |\n| [0.17.1](/llm/markdown/app/references/changelog.md#0-17-1) | Added `ctrl`, `cmd`, `shift`, and `alt` keyboard modifiers |\n| [0.16.3](/llm/markdown/app/references/changelog.md#0-16-3) | Supports for typing in elements with `tabindex` attribute |\n| [0.16.2](/llm/markdown/app/references/changelog.md#0-16-2) | Added `{downarrow}` and `{uparrow}` character sequences |\n| [0.8.0](/llm/markdown/app/references/changelog.md#0-8-0) | Outputs Key Events Table to console on click |\n| [0.8.0](/llm/markdown/app/references/changelog.md#0-8-0) | Added `{selectall}`, `{del}`, `{backspace}`, `{esc}`, `{{}`, `{enter}`, `{leftarrow}`, `{rightarrow}` character sequences |\n| [0.8.0](/llm/markdown/app/references/changelog.md#0-8-0) | Added small delay (10ms) between each keystroke during `cy.type()` |\n| [0.6.12](/llm/markdown/app/references/changelog.md#0-6-12) | Added option `force` |\n",
      "section": "api",
      "anchors": [
        "history"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 243
    },
    {
      "id": "api/commands/type#see-also",
      "doc_id": "api/commands/type",
      "heading": "See also",
      "heading_level": 2,
      "content_markdown": "## See also\n\n*   [`cy.press()`](/llm/markdown/api/commands/press.md) - For single key events and navigation\n*   [`.focus()`](/llm/markdown/api/commands/focus.md) - Focus elements before typing\n*   [`.clear()`](/llm/markdown/api/commands/clear.md) - Clear input values\n*   [`.blur()`](/llm/markdown/api/commands/blur.md) - Remove focus from elements\n*   [`.click()`](/llm/markdown/api/commands/click.md) - Click elements\n*   [`.submit()`](/llm/markdown/api/commands/submit.md) - Submit forms\n*   [`Cypress.Keyboard`](/llm/markdown/api/cypress-api/keyboard-api.md) - Keyboard constants\n",
      "section": "api",
      "anchors": [
        "see-also"
      ],
      "path": "/llm/json/chunked/api/commands/type.json",
      "token_estimate": 63
    }
  ]
}