> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Change browser defaults

> Change the default properties for the HTML input element when using custom search boxes.

<div className="not-prose algolia-flavor-switcher">
  <div className="afs-dropdown">
    <div className="afs-trigger" role="button" tabIndex="0" aria-haspopup="listbox">
      <span className="afs-current">React</span>

      <svg className="afs-chevron lucide lucide-chevron-down" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
        <path d="m6 9 6 6 6-6" />
      </svg>
    </div>

    <ul className="afs-menu" role="listbox">
      <li role="option" aria-selected="false"><a className="afs-option" href="/doc/guides/building-search-ui/widgets/disabling-default-browser-behavior/js"><span className="afs-option-name">JavaScript</span><span className="afs-option-lib">InstantSearch.js</span></a></li>
      <li role="option" aria-selected="true"><a className="afs-option is-current" href="/doc/guides/building-search-ui/widgets/disabling-default-browser-behavior/react"><span className="afs-option-name">React</span><span className="afs-option-lib">React InstantSearch</span></a></li>
      <li role="option" aria-selected="false"><a className="afs-option" href="/doc/guides/building-search-ui/widgets/disabling-default-browser-behavior/vue"><span className="afs-option-name">Vue</span><span className="afs-option-lib">Vue InstantSearch</span></a></li>
    </ul>
  </div>
</div>

<Note>
  This is the **React InstantSearch v7** documentation.
  If you're upgrading from v6, see the [upgrade guide](/doc/guides/building-search-ui/upgrade-guides/react/#migrate-from-react-instantsearch-v6-to-react-instantsearch-v7).
  If you were using React InstantSearch Hooks,
  this v7 documentation applies—just check for [necessary changes](/doc/guides/building-search-ui/upgrade-guides/react/#migrate-from-react-instantsearch-hooks-to-react-instantsearch-v7).
  To continue using v6, you can find the [archived documentation](https://algolia.com/old-docs/deprecated/instantsearch/react/v6/api-reference/instantsearch/).
</Note>

**If you don't use the built-in InstantSearch or Autocomplete components to render a search box, you need to change the default properties of the HTML input element** to turn off the default autocomplete behavior of the browser.

A classic search HTML input looks like:

```html HTML icon=code-xml theme={"system"}
<input type="text" id="search" />
```

When a user starts typing into this input, the browser may use its default search-as-you-type behavior,
which interferes with the custom search box. This guide describes how to avoid this behavior.

## Update input attributes

Set these attributes on the HTML input element to turn off the browser's default behavior:

```html HTML icon=code-xml theme={"system"}
<input
  type="text"
  id="search"
  autocomplete="off"
  autocorrect="off"
  autocapitalize="none"
  spellcheck="false"
/>
```

<Info>
  In Chrome, `autocomplete="off"` doesn't work.
  In Chrome, you can [turn off autocomplete](https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#Disabling_autocompletion)
  by setting the attribute to an invalid value like `autocomplete="nope"`.
  The same solution doesn't work in Firefox (it disregards the invalid value and reverts to the default autocompletion behavior).
</Info>

## See also

For more information, see these references:

* [How to turn autocomplete off](https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion)
* [Autocomplete](https://developer.mozilla.org/en/docs/Web/HTML/Element/Input#attr-autocomplete)
* [`autocorrect` attribute](https://developer.mozilla.org/en/docs/Web/HTML/Element/Input#attr-autocorrect)
* [`autocapitalize` attribute](https://developer.mozilla.org/en/docs/Web/HTML/Element/Input#attr-autocapitalize)
* [Spellcheck](https://developer.mozilla.org/en/docs/Web/HTML/Element/Input#attr-spellcheck)
