https://github.com/ryanmorr/is-element-supported
Feature test HTML element support
https://github.com/ryanmorr/is-element-supported
dom element feature-testing html javascript support
Last synced: 10 months ago
JSON representation
Feature test HTML element support
- Host: GitHub
- URL: https://github.com/ryanmorr/is-element-supported
- Owner: ryanmorr
- License: unlicense
- Created: 2013-10-10T20:26:35.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-01-23T18:09:18.000Z (about 2 years ago)
- Last Synced: 2025-04-09T16:09:31.486Z (10 months ago)
- Topics: dom, element, feature-testing, html, javascript, support
- Language: JavaScript
- Homepage:
- Size: 145 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# isElementSupported
[![Version Badge][version-image]][project-url]
[![License][license-image]][license-url]
[![Build Status][build-image]][build-url]
> Feature test HTML element support
## Install
Download the [CJS](https://github.com/ryanmorr/is-element-supported/raw/master/dist/cjs/is-element-supported.js), [ESM](https://github.com/ryanmorr/is-element-supported/raw/master/dist/esm/is-element-supported.js), [UMD](https://github.com/ryanmorr/is-element-supported/raw/master/dist/umd/is-element-supported.js) versions or install via NPM:
``` sh
npm install @ryanmorr/is-element-supported
```
## Usage
Detect support for an HTML element by providing the tag name:
```javascript
import isElementSupported from '@ryanmorr/is-element-supported';
// Feature test a known supported element
isElementSupported('div'); //=> true
// Feature test an unsupported element
isElementSupported('foo'); //=> false
```
**Note:** SVG and MathML tags are not supported.
## License
This project is dedicated to the public domain as described by the [Unlicense](http://unlicense.org/).
[project-url]: https://github.com/ryanmorr/is-element-supported
[version-image]: https://img.shields.io/github/package-json/v/ryanmorr/is-element-supported?color=blue&style=flat-square
[build-url]: https://github.com/ryanmorr/is-element-supported/actions
[build-image]: https://img.shields.io/github/actions/workflow/status/ryanmorr/is-element-supported/node.js.yml?style=flat-square
[license-image]: https://img.shields.io/github/license/ryanmorr/is-element-supported?color=blue&style=flat-square
[license-url]: UNLICENSE