统计HTML 标签CSS 属性 和 JS 关键字

news2024/9/23 11:15:45

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>统计HTML 标签、CSS 属性 和 JS 关键字</title>
</head>
<style>
    #container {
        display: flex;
    }
    li {
        list-style: none;
    }
</style>
<body>
    <div id="container">
        <div>
            <h3> HTML 标签</h3>
            <div id="countHTML"></div>
        </div>
        <div>
            <h3> CSS 属性</h3>
            <div id="countCSS"></div>
        </div>
        <div>
            <h3> JS 关键字</h3>
            <div id="countJS"></div>
        </div>
    </div>
    <script>
        // 获取所有 HTML 标签
        const htmlTags = new Set([
            'a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'svg', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr'
        ]);
        // 获取所有 CSS 属性
        const cssProperties = new Set([
            'align-content', 'align-items', 'align-self', 'all', 'animation', 'animation-delay', 'animation-direction', 'animation-duration', 'animation-fill-mode', 'animation-iteration-count', 'animation-name', 'animation-play-state', 'animation-timing-function', 'backface-visibility', 'background', 'background-attachment', 'background-blend-mode', 'background-clip', 'background-color', 'background-image', 'background-origin', 'background-position', 'background-repeat', 'background-size', 'border', 'border-bottom', 'border-bottom-color', 'border-bottom-left-radius', 'border-bottom-right-radius', 'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-image', 'border-image-outset', 'border-image-repeat', 'border-image-slice', 'border-image-source', 'border-image-width', 'border-left', 'border-left-color', 'border-left-style', 'border-left-width', 'border-radius', 'border-right', 'border-right-color', 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top', 'border-top-color', 'border-top-left-radius', 'border-top-right-radius', 'border-top-style', 'border-top-width', 'border-width', 'bottom', 'box-decoration-break', 'box-shadow', 'box-sizing', 'break-after', 'break-before', 'break-inside', 'caption-side', 'caret-color', 'clear', 'clip', 'color', 'column-count', 'column-fill', 'column-gap', 'column-rule', 'column-rule-color', 'column-rule-style', 'column-rule-width', 'column-span', 'column-width', 'columns', 'content', 'counter-increment', 'counter-reset', 'cursor', 'direction', 'display', 'empty-cells', 'filter', 'flex', 'flex-basis', 'flex-direction', 'flex-flow', 'flex-grow', 'flex-shrink', 'flex-wrap', 'float', 'font', 'font-family', 'font-feature-settings', 'font-kerning', 'font-language-override', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-synthesis', 'font-variant', 'font-variant-caps', 'font-variant-east-asian', 'font-variant-ligatures', 'font-variant-numeric', 'font-variant-position', 'font-weight', 'grid', 'grid-area', 'grid-auto-columns', 'grid-auto-flow', 'grid-auto-rows', 'grid-column', 'grid-column-end', 'grid-column-gap', 'grid-column-start', 'grid-gap', 'grid-row', 'grid-row-end', 'grid-row-gap', 'grid-row-start', 'grid-template', 'grid-template-areas', 'grid-template-columns', 'grid-template-rows', 'hanging-punctuation', 'height', 'hyphens', 'image-rendering', 'isolation', 'justify-content', 'left', 'letter-spacing', 'line-height', 'list-style', 'list-style-image', 'list-style-position', 'list-style-type', 'margin', 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'max-height', 'max-width', 'min-height', 'min-width', 'mix-blend-mode', 'object-fit', 'object-position', 'opacity', 'order', 'outline', 'outline-color', 'outline-offset', 'outline-style', 'outline-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'page-break-after', 'page-break-before', 'page-break-inside', 'perspective', 'perspective-origin', 'pointer-events', 'position', 'quotes', 'resize', 'right', 'scroll-behavior', 'tab-size', 'table-layout', 'text-align', 'text-align-last', 'text-combine-upright', 'text-decoration', 'text-decoration-color', 'text-decoration-line', 'text-decoration-style', 'text-indent', 'text-justify', 'text-orientation', 'text-overflow', 'text-shadow', 'text-transform', 'top', 'transform', 'transform-origin', 'transform-style', 'transition', 'transition-delay', 'transition-duration', 'transition-property', 'transition-timing-function', 'unicode-bidi', 'user-select', 'vertical-align', 'visibility', 'white-space', 'width', 'word-break', 'word-spacing', 'word-wrap', 'writing-mode', 'z-index'
        ]);
        // 获取所有 JS 关键字
        const jsKeywords = new Set([
            'break', 'case', 'catch', 'class', 'const', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'export', 'extends', 'finally', 'for', 'function', 'if', 'import', 'in', 'instanceof', 'new', 'return', 'super', 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'yield'
        ]);
        // 输出属性列表
        function renderList(containerId, items) {
            const container = document.getElementById(containerId);
            const ul = document.createElement('ul');
            container.innerHTML = ''; // 清空之前的列表
            container.appendChild(ul);
            items.forEach((item, index) => {
                const li = document.createElement('li');
                li.textContent = `${index + 1}. ${item}`; // 添加序号
                ul.appendChild(li);
            });
        }
        renderList('countCSS', Array.from(cssProperties).sort());
        renderList('countHTML', Array.from(htmlTags).sort());
        renderList('countJS', Array.from(jsKeywords).sort());
    </script>
</body>
</html>

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1926973.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【青书学堂】2024年第一学期 平面设计(高起专) 作业

【青书学堂】2024年第一学期 平面设计(高起专) 作业 为了方便日后复习&#xff0c;青书学堂成人大专试题整理。 若有未整理的课程&#xff0c;请私信我补充&#xff0c;欢迎爱学习的同学们收藏点赞关注&#xff01;文章内容仅限学习使用&#xff01;&#xff01;&#xff01; 第…

MacCleaner Pro Mac系统综合清理工具包 释放磁盘空间,提高整体性能

MacCleaner Pro 是一款专为 Mac 用户设计的软件工具&#xff0c;用于优化和清理他们的系统。它提供了一系列功能来帮助用户加速他们的 Mac&#xff0c;释放磁盘空间&#xff0c;并提高整体性能。 MacCleaner Pro 的一些主要功能包括&#xff1a; 系统清理&#xff1a;此功能有…

捷配笔记-如何确保PCB信号完整性?

三十年的电子设计历程&#xff0c;是一段从微米到纳米的跨越之旅。1987年&#xff0c;0.5微米工艺曾被视为技术的极限&#xff0c;而如今22纳米工艺已成为行业的新标准。本文将回顾这段技术革新的历程&#xff0c;并探讨在这一过程中我们所面临的挑战与应对策略。 技术演进的里…

python自动化flask库-从数据库里取出数据

实现效果&#xff1a;写一个接口&#xff0c;从mysql数据库读到user表的数据&#xff08;用户名和密码&#xff09;&#xff0c;把数据作为回参 用到的库&#xff1a;flask&#xff0c;pymysql 代码&#xff1a; from flask import Flask, jsonify import pymysql# 连接数据…

python-箭形图案(赛氪OJ)

[题目描述] 小理学习了循环&#xff0c;老师给他出了一系列打印图案的练习&#xff0c;该任务是打印用“ ∗ ”组成的箭形图案。输入格式&#xff1a; 一行一个整数 n。输出格式&#xff1a; 针对输入的 n &#xff0c;输出用“ ∗ ”组成的箭形。 …

AirSim+PX4联合仿真

AirSim启动设置 windows上的AirSim要想通过PX4进行控制,需要配置一下参数,进入如下路径的AirSim文件,找到settings.json文件,采用记事本打开,并编辑里面的内容。 可以参考如下内容:其中ip要对应,linux上PX4导入的ip即为此处的localhostip,也是WSL服务的ip。 {"S…

Java中的Stack(栈)(如果想知道Java中有关Stack的知识点,那么只看这一篇就足够了!)

前言&#xff1a;栈&#xff08;Stack&#xff09;是一种基础且重要的数据结构&#xff0c;以其后进先出&#xff08;LIFO, Last In First Out&#xff09;的特性广泛应用于计算机科学和编程中。 ✨✨✨这里是秋刀鱼不做梦的BLOG ✨✨✨想要了解更多内容可以访问我的主页秋刀鱼…

XLPR车牌自动识别开发包

XLPR SDK适用于为各种应用增加车牌自动识别能力&#xff0c;支持多个区域检测&#xff0c;支持车牌颜色和号码输出&#xff0c;提供Web API和 原生API。官方下载地址&#xff1a;XLPR车牌识别开发包。 XLPR主要由三个主要部分构成&#xff1a;D-Net、R-NET和C-Net&#xff0c;…

初识Spring6框架

个人笔记梳理&#xff0c;仅供参考 Spring是一款主流的JavaEE轻量级开源框架 Spring的狭义和广义 广义的Spring&#xff1a;Spring技术栈 泛指以Spring Framework为核心的Spring技术栈 经过十多年的发展&#xff0c;Spring已经不再是一个单纯的应用框架&#xff0c;而是逐…

mybatis语法进阶1

日志的使用 我们在使用MyBatis的时候, 其实MyBatis框架会打印一些必要的日志信息, 在开发阶段这些日志信息对我们分析问题,理解代码的执行是特别有帮助的; 包括项目上线之后,我们也可以收集项目的错误日志到文件里面去; 所以我们采用专门的日志系统来处理. 步骤 导入坐标拷贝…

电脑技巧:分享10个有趣的的网站

目录 1、少女生成器 2、动漫捏脸 3、小霸王其乐无穷 4、Theuselessweb 5、Mikutap 6、nazo.one-story 7、在线连连看 8、中午吃什么 9、假装更新系统 10、越摇摆越快乐 分享10个好玩有趣的小众宝藏网站&#xff0c;90%的人都没有玩过&#xff0c;随便哪个都能玩上一天…

SqlServer SQL语句或存储过程运行慢 使用 WITH RECOMP ILE 或 OPTION (RECOMPILE)(重新编译)

如果您的存储过程包含参数可以重新申明变量把参数接收下&#xff0c;可能解决你过程执行慢的原因。如果未能解决&#xff0c;请参考以下文章内容&#xff1a; WITH RECOMPILE 子句可以在以下地方使用&#xff1a; 一种是当你创建一个过程时&#xff0c;例如&#xff1a; CREA…

海事无人机解决方案

海事巡察 海事巡察现状 巡查效率低下&#xff0c;存在视野盲区&#xff0c;耗时长&#xff0c;人力成本高。 海事的职能 统一管理水上交通安全和防治船舶污染。 管理通航秩序、通航环境。负责水域的划定和监督管理&#xff0c;维护水 上交通秩序&#xff1b;核定船舶靠泊安…

顺序表算法 - 移除元素

. - 力扣&#xff08;LeetCode&#xff09;. - 备战技术面试&#xff1f;力扣提供海量技术面试资源&#xff0c;帮助你高效提升编程技能,轻松拿下世界 IT 名企 Dream Offer。https://leetcode.cn/problems/remove-element/description/思路: 代码: // numsSize表示数组的长度 …

子数组问题

目录 最大子数组和 环形子数组的最大和 乘积最大子数组 乘数为正数的最长子数组长度 等差数列划分 最长湍流子数组 单词拆分 环绕字符串中唯一的子字符串 声明&#xff1a;接下来主要使用动态规划来解决问题&#xff01;&#xff01;&#xff01; 最大子数组和 题目 …

数据结构进阶——使用数组实现栈和队列详解与示例(C,C#,C++)

文章目录 1、数组实现栈栈的基本操作C语言实现C#语言实现 2、 数组实现队列队列的基本操作C语言实现C# 语言实现C语言实现 总结 在编程世界中&#xff0c;数据结构是构建高效算法的基石。栈和队列作为两种基本的数据结构&#xff0c;它们的应用非常广泛。本文将带领大家使用C&a…

【OrangePi AIpro】: 探索AI加成的开源硬件魅力

&#x1f308;个人主页: 鑫宝Code &#x1f525;热门专栏: 闲话杂谈&#xff5c; 炫酷HTML | JavaScript基础 ​&#x1f4ab;个人格言: "如无必要&#xff0c;勿增实体" 文章目录 Orange Pi: 探索开源硬件的魅力引言Orange Pi概述OrangePi AIPro产品介绍试用体…

STM32第二十课:FreeRTOS任务管理和信号量

目录 一、任务管理方式二、任务堆栈溢出检测三、二值信号量&#xff08;任务同步&#xff09;四、计数信号量五、互斥信号量六、队列 一、任务管理方式 1.任务创建成功后会添加到就绪链表中&#xff0c;开启调度器&#xff0c;此时任务调度器会去就绪链表中找优先级最高的任务执…

数据增强新方法SUMix:解决Mixup混合后的图像的内容与其标签不匹配问题

数据增强新方法SUMix&#xff1a;解决Mixup混合后的图像的内容与其标签不匹配问题 提出背景当前混合方法的问题MixUp 操作标签混合混合交叉熵&#xff08;MCE&#xff09;混合交叉熵&#xff08;MCE&#xff09;的核心作用混合交叉熵&#xff08;MCE&#xff09;的功能 CutMix原…

$accumulator(聚合)

$accumulator 是 MongoDB 聚合管道中用于自定义数据处理逻辑的一个算子&#xff0c;它允许用户使用 JavaScript 编写代码来控制数据的初始化、累积、合并和最终输出。下面是对 $accumulator 各个部分的详细解释&#xff1a; init: 这是一个 JavaScript 函数&#xff0c;用于初…