# html-element-map

> Look up HTML tag names via HTML Element constructors, and vice versa.

Latest version **1.4.1** (published 2026-09-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install html-element-map
pnpm add html-element-map
yarn add html-element-map
bun add html-element-map
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2026-09-29 |
| First published | 2019-01-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 0.4 |
| Dependencies | 2 |
| Unpacked size | 34.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Jordan Harband |
| Maintainers | ljharb |
| Keywords | html, element, tag, lookup, html, element, constructor |

## Links

- npm: https://www.npmjs.com/package/html-element-map
- Repository: https://github.com/ljharb/html-element-map
- Homepage: https://github.com/ljharb/html-element-map#readme
- Issues: https://github.com/ljharb/html-element-map/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/html-element-map

## Dependencies (2)

- [es-errors](https://npm.io/package/es-errors.md) ^1.3.0
- [array.prototype.filter](https://npm.io/package/array.prototype.filter.md) ^1.0.4

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.4.1 (latest) — 2026-09-29
- 1.4.0 — 2026-01-11
- 1.3.1 — 2021-05-19
- 1.3.0 — 2021-01-23
- 1.2.0 — 2019-11-20
- 1.1.0 — 2019-07-19
- 1.0.1 — 2019-03-27
- 1.0.0 — 2019-01-27

## README

# html-element-map <sup>[![Version Badge][npm-version-svg]][package-url]</sup>

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][npm-badge-png]][package-url]

Look up HTML tag names via HTML Element constructors, and vice versa.

## Entry points

### `byTag`

```js
const assert = require('assert');
const byTag = require('html-element-map/byTag');
// or: import byTag from 'html-element-map/byTag';
// or: import { byTag } from 'html-element-map';

assert.deepEqual(
		byTag('a'),
		[{
				constructor: window.HTMLAnchorElement,
				constructorName: 'HTMLAnchorElement',
				expectedConstructor: window.HTMLAnchorElement,
				tag: 'a'
		}],
);
```

### `byConstructor`

```js
const assert = require('assert');
const byConstructor = require('html-element-map/byConstructor');
// or: import byConstructor from 'html-element-map/byConstructor';
// or: import { byConstructor } from 'html-element-map';

assert.deepEqual(
		byConstructor(window.HTMLAnchorElement),
		[{
				constructor: window.HTMLAnchorElement,
				constructorName: 'HTMLAnchorElement',
				expectedConstructor: window.HTMLAnchorElement,
				tag: 'a'
		}],
);
```

### `byConstructorName`

```js
const assert = require('assert');
const byConstructorName = require('html-element-map/byConstructorName');
// or: import byConstructorName from 'html-element-map/byConstructorName';
// or: import { byConstructorName } from 'html-element-map';

assert.deepEqual(
		byConstructorName('HTMLAnchorElement'),
		[{
				constructor: window.HTMLAnchorElement,
				constructorName: 'HTMLAnchorElement',
				expectedConstructor: window.HTMLAnchorElement,
				tag: 'a'
		}],
);
```

[package-url]: https://npmjs.org/package/html-element-map
[npm-version-svg]: https://versionbadg.es/ljharb/html-element-map.svg
[deps-svg]: https://david-dm.org/ljharb/html-element-map.svg
[deps-url]: https://david-dm.org/ljharb/html-element-map
[dev-deps-svg]: https://david-dm.org/ljharb/html-element-map/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/html-element-map#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/html-element-map.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/html-element-map.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/html-element-map.svg
[downloads-url]: https://npm-stat.com/charts.html?package=html-element-map
[codecov-image]: https://codecov.io/gh/ljharb/html-element-map/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/html-element-map/
[actions-image]: https://img.shields.io/github/check-runs/ljharb/html-element-map/main
[actions-url]: https://github.com/ljharb/html-element-map/actions

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