> For the complete documentation index, see [llms.txt](https://mobius-studios.gitbook.io/selectable/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mobius-studios.gitbook.io/selectable/api/methods/toggle.md).

# toggle()

***

```javascript
/**
 * @param  {Mixed} item
 * @param  {Boolean} bool
 * @return {Boolean}
 */
selectable.toggle(choice, bool)
```

***

Toggles the state of the given item(s)

***

The first argument is the item(s) you want to toggle:

* `HTMLElement`
* `HTMLCollection`&#x20;
* `NodeList`
* `Number` - the index of the selectable element in the `items` array
* `Object` - a reference to the `item` stored in the `items` array
* `Array` - an array of `HTMLElement`, indexes or item references

The second optional argument accepts a `boolean` to force the selected state.

***
