Skip to content

Instantly share code, notes, and snippets.

View thewebartisan7's full-sized avatar

Damir thewebartisan7

  • Localhost
View GitHub Profile
@thewebartisan7
thewebartisan7 / retrieve-valid-html-attributes.js
Created December 6, 2022 10:50
Retrieve valid HTML attributes
/* eslint-disable no-undef */
/* eslint-disable curly */
/* eslint-disable padded-blocks */
const elementAttributes = {};
// Exception
// tabindex seem to be allowed on any element according to https://www.w3schools.com/tags/att_global_tabindex.asp
// but here https://www.w3.org/TR/html4/index/attributes.html seem not
// So below we add this exception
const allowedAttributes = ['tabindex'];