html-element-map
v1.3.1
Published
Look up HTML tag names via HTML Element constructors, and vice versa.
Downloads
7,864,746
Maintainers
Readme
html-element-map
Look up HTML tag names via HTML Element constructors, and vice versa.
Entry points
byTag
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
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
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'
}],
);