--- title: not comments: true description: '' --- Remove DOM elements from the set of DOM elements. Opposite of [`cy.filter()`](https://on.cypress.io/api/filter) | | | |--- | --- | | **Returns** | the new DOM element(s) found by the command. | | **Timeout** | `cy.not` will retry for the duration of the [`defaultCommandTimeout`](https://on.cypress.io/guides/configuration#timeouts) | # [cy.not( *selector* )](#selector-usage) Remove the element(s) by it's selector from the elements # Options Pass in an options object to change the default behavior of `cy.not`. **cy.not( *selector*, *options* )** Option | Default | Notes --- | --- | --- `log` | `true` | whether to display command in command log `timeout` | [`defaultCommandTimeout`](https://on.cypress.io/guides/configuration#timeouts) | Total time to retry getting the element # Selector Usage ## Filter the current subject to the elements that do not have class `active`. ```javascript cy.get('.left-nav>.nav').find('>li').not('.active') ``` # Command Log ## Find all buttons that are not of type submit ```javascript cy.get('form').find('button').not('[type="submit"]') ``` The commands above will display in the command log as: screen shot 2015-11-29 at 12 36 49 pm When clicking on `not` within the command log, the console outputs the following: screen shot 2015-11-29 at 12 37 39 pm # See also - [filter](https://on.cypress.io/api/filter)