html-all-known-attributes examples

Table of Contents

Quick Take

import { strict as assert } from "assert";
import { allHtmlAttribs } from "html-all-known-attributes";

assert.equal(allHtmlAttribs.has("href"), true);

assert.equal(allHtmlAttribs.size, 702);

// iterating:
const gathered = [];
for (const x of allHtmlAttribs) {
  // push first three
  if (gathered.length < 3) {
    gathered.push(x);
  }
}
assert.deepEqual(gathered, [
  "abbr",
  "accept",
  "accept-charset",
]);