Greasy Fork

suizhikuo-remove-all-disabled

js去掉所有元素的disabled

当前为 2024-06-19 提交的版本,查看 最新版本

// ==UserScript==
// @name         suizhikuo-remove-all-disabled
// @namespace    http://tampermonkey.net/
// @version      2024-06-19
// @description  js去掉所有元素的disabled
// @author       随智阔
// @match	     *://*/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @require      https://code.jquery.com/jquery-3.7.1.js
// @license MIT
// ==/UserScript==

(function () {
    'use strict';
    debugger;
    $(window).bind("load", function () {
        console.log("篡改猴(Tampermonkey)脚本--->运行-->js去掉所有元素的disabled");
        如何让自己的js最后执行如何让自己的js最后执行
        var allElements = document.querySelectorAll('*');
        // 遍历所有选择的元素
        allElements.forEach(function (element) {
            console.log(element.tagName); // 输出元素的标签名
            // 移除disabled属性
            element.removeAttribute("disabled");
        });
    });
})();