1.0.3 • Published 2 years ago

get-html-attributes v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

get-html-attributes

Get all HTML attributes and the Elements that use them. You can also just get all elements.

Note

The data is fetched from the MDN Web Docs (Elements, Attributes). Because of this when one of the websites changes their HTML (in a certain way), this package will not work propaly anymore. In this case the package will be updated as soon as possible.

Exports

import getAttributes from "get-html-attributes";

or

import { getElements } from "get-html-attributes";

Usage

//The argument is optional
const attributes = await getAttributes({
    deprecatedElements: false,
    deprecatedAttributes: false,
    noExperimentalAttributes: false,
});

const elements = await getElements(); // -> [a, abbr, ...]

const globalAttrs = attributes.get("@global"); // -> [accesskey, contenteditable, ...]
const attrsOfForm = attributes.get("form"); // -> [action, target, ...]
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago