# element-matches-polyfill

> Element.matches Polyfill

Latest version **1.0.0** (published 2019-02-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install element-matches-polyfill
pnpm add element-matches-polyfill
yarn add element-matches-polyfill
bun add element-matches-polyfill
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-02-01 |
| First published | 2019-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | mboughaba |
| Maintainers | mboughaba |
| Keywords | Element, matches, polyfill, mdn, ie, edge |

## Links

- npm: https://www.npmjs.com/package/element-matches-polyfill
- Repository: https://github.com/mboughaba/element-matches-polyfill
- Homepage: https://github.com/mboughaba/element-matches-polyfill#readme
- Issues: https://github.com/mboughaba/element-matches-polyfill/issues
- npm.io page: https://npm.io/package/element-matches-polyfill

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-02-01

## README

# element-matches-polyfill
Polyfill for Element.matches

Provides a polyfill for [Element.forEach()](https://developer.mozilla.org/en-US/docs/Web/API/Element/matches) to all Browsers.

## Native support

See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/matches) for more information.

## Import

```JavaScript
// CommonJS
require('element-matches-polyfill');

// ES6 Modules import / Typescript import
import 'element-matches-polyfill';
```

## Usage

```HTML
<ul id="birds">
  <li>Orange-winged parrot</li>
  <li class="endangered">Philippine eagle</li>
  <li>Great white pelican</li>
</ul>

<script type="text/javascript">
  var birds = document.getElementsByTagName('li');

  for (var i = 0; i < birds.length; i++) {
    if (birds[i].matches('.endangered')) {
      console.log('The ' + birds[i].textContent + ' is endangered!');
    }
  }
</script>
```

---
_Source: https://npm.io/package/element-matches-polyfill · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
