Skip to content

Instantly share code, notes, and snippets.

@serradura
Created March 27, 2018 22:20
Show Gist options
  • Save serradura/a5c9d4d06312fde242fb2e0594fc2eb0 to your computer and use it in GitHub Desktop.
Save serradura/a5c9d4d06312fde242fb2e0594fc2eb0 to your computer and use it in GitHub Desktop.
HTML Element Reference as a JSON/Javascript
/*
// https://www.w3schools.com/tags/default.asp
JSON.stringify(
Array.prototype.slice.call(
document.querySelectorAll('.w3-table-all tr')
)
.map(tr => tr.querySelector('td'))
.filter(n => !!n)
.map(n => n.innerText)
)
*/
var TagsCategories = {
basic: ['<!DOCTYPE>', '<html>', '<head>', '<title>', '<body>', '<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<p>', '<br>', '<hr>', '<!--...-->'],
formatting: [
'<acronym>', '<abbr>', '<address>', '<b>', '<bdi>', '<bdo>', '<big>', '<blockquote>', '<center>', '<cite>', '<code>', '<del>', '<dfn>', '<em>',
'<font>', '<i>', '<ins>', '<kbd>', '<mark>', '<meter>', '<pre>', '<progress>', '<q>', '<rp>', '<rt>', '<ruby>', '<s>', '<samp>', '<small>', '<strike>', '<strong>',
'<sub>', '<sup>', '<template>', '<time>', '<tt>', '<u>', '<var>', '<wbr>'
],
formsAndInput: ['<form>', '<input>', '<textarea>', '<button>', '<select>', '<optgroup>', '<option>', '<label>', '<fieldset>', '<legend>', '<datalist>', '<output>'],
frames: ['<frame>', '<frameset>', '<noframes>', '<iframe>'],
images: ['<img>', '<map>', '<area>', '<canvas>', '<figcaption>', '<figure>', '<picture>', '<svg>'],
audioVideo: ['<audio>', '<source>', '<track>', '<video>'],
links: ['<a>', '<link>', '<nav>'],
lists: ['<ul>', '<ol>', '<li>', '<dir>', '<dl>', '<dt>', '<dd>', '<menu>', '<menuitem>'],
tables: ['<table>', '<caption>', '<th>', '<tr>', '<td>', '<thead>', '<tbody>', '<tfoot>', '<col>', '<colgroup>'],
stylesAndSemantic: ['<style>', '<div>', '<span>', '<header>', '<footer>', '<main>', '<section>', '<article>', '<aside>', '<details>', '<dialog>', '<summary>', '<data>'],
metaInfo: ['<head>', '<meta>', '<base>', '<basefont>'],
programming: ['<script>', '<noscript>', '<applet>', '<embed>', '<object>', '<param>']
};
var allTags = [
'<!--...-->', '<!DOCTYPE>', '<a>', '<abbr>', '<acronym>', '<address>', '<applet>', '<area>', '<article>', '<aside>', '<audio>', '<b>', '<base>',
'<basefont>', '<bdi>', '<bdo>', '<big>', '<blockquote>', '<body>', '<br>', '<button>', '<canvas>', '<caption>', '<center>', '<cite>', '<code>',
'<col>', '<colgroup>', '<datalist>', '<dd>', '<del>', '<details>', '<dfn>', '<dialog>', '<dir>', '<div>', '<dl>', '<dt>', '<em>', '<embed>',
'<fieldset>', '<figcaption>', '<figure>', '<font>', '<footer>', '<form>', '<frame>', '<frameset>', '<h1> to <h6>', '<head>', '<header>',
'<hr>', '<html>', '<i>', '<iframe>', '<img>', '<input>', '<ins>', '<kbd>', '<label>', '<legend>', '<li>', '<link>', '<main>', '<map>', '<mark>',
'<menu>', '<menuitem>', '<meta>', '<meter>', '<nav>', '<noframes>', '<noscript>', '<object>', '<ol>', '<optgroup>', '<option>', '<output>',
'<p>', '<param>', '<picture>', '<pre>', '<progress>', '<q>', '<rp>', '<rt>', '<ruby>', '<s>', '<samp>', '<script>', '<section>', '<select>',
'<small>', '<source>', '<span>', '<strike>', '<strong>', '<style>', '<sub>', '<summary>', '<sup>', '<svg>', '<table>', '<tbody>', '<td>',
'<template>', '<textarea>', '<tfoot>', '<th>', '<thead>', '<time>', '<title>', '<tr>', '<track>', '<tt>', '<u>', '<ul>', '<var>', '<video>', '<wbr>'
];
// ---
var allNames = [
'a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base',
'basefont', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code',
'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'em', 'embed',
'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header',
'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark',
'menu', 'menuitem', 'meta', 'meter', 'nav', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output',
'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select',
'small', 'source', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'svg', 'table', 'tbody', 'td',
'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr'
];
var namesByCategories = {
basic: [ 'html', 'head', 'title', 'body', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'br', 'hr' ],
formatting: [
'acronym', 'abbr', 'address', 'b', 'bdi', 'bdo', 'big', 'blockquote', 'center', 'cite', 'code', 'del', 'dfn', 'em',
'font', 'i', 'ins', 'kbd', 'mark', 'meter', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'small', 'strike', 'strong',
'sub', 'sup', 'template', 'time', 'tt', 'u', 'var', 'wbr'
],
formsAndInput: ['form', 'input', 'textarea', 'button', 'select', 'optgroup', 'option', 'label', 'fieldset', 'legend', 'datalist', 'output'],
frames: ['frame', 'frameset', 'noframes', 'iframe'],
images: ['img', 'map', 'area', 'canvas', 'figcaption', 'figure', 'picture', 'svg'],
audioVideo: ['audio', 'source', 'track', 'video'],
links: ['a', 'link', 'nav'],
lists: ['ul', 'ol', 'li', 'dir', 'dl', 'dt', 'dd', 'menu', 'menuitem'],
tables: ['table', 'caption', 'th', 'tr', 'td', 'thead', 'tbody', 'tfoot', 'col', 'colgroup'],
stylesAndSemantic: ['style', 'div', 'span', 'header', 'footer', 'main', 'section', 'article', 'aside', 'details', 'dialog', 'summary', 'data'],
metaInfo: ['head', 'meta', 'base', 'basefont'],
programming: ['script', 'noscript', 'applet', 'embed', 'object', 'param']
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment