您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
// ==UserScript== // @name 超多选项Select附加搜索框 // @namespace http://ynotme.cn/ // @version 0.1 // @description try to take over the world! // @author zhangtao103239 // @match *://*/* // @grant none // ==/UserScript== (function() { selections = document.getElementsByTagName('select'); for (var i = 0; i < selections.length; i++) { var selection = selections[i]; if (selection.length > 20) { var ins = document.createElement('input'); ins["data-indexCount"] = i; ins.onkeypress = function (e) { if (e.keyCode == 13) { var value = ins.value; var indexCount = ins["data-indexCount"] var selection = selections[indexCount] for (var j = 0; j < selection.length; j++) { if (selection[j].label == value) { selection[j].selected = true; break; } } } } selection.parentElement.appendChild(ins); } } // Your code here... })();