> For the complete documentation index, see [llms.txt](https://jscula.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jscula.gitbook.io/docs/manipulation/.every.md).

# .every()

Checks whether every item in a collection matches a condition.

```javascript
const allFilled = $('form input*').every(input => input.hasValue());
```

### Use cases

Use `.every()` when all matching elements must satisfy a condition:

* Confirm that required form inputs have values.
* Check that every upload completed successfully.
* Verify that all selected items are available.

### More examples

Check whether every checkbox is selected:

```javascript
const allAccepted = $('.terms input*').every(input => input.isChecked());
```

Check whether every product is in stock:

```javascript
const allInStock = $('.product*').every(product => {
  return product.attr('data-stock') === 'available';
});
```
