// ==UserScript== // @name 自动评教 // @namespace https://bbs.tampermonkey.net.cn/ // @version 0.1.0 // @description try to take over the world! // @author Mask // @match https://lz.changdian2001.com/TCStudent/SStudentEvaluateTeacher.aspx?* // ==/UserScript== (function() { 'use strict'; console.log("加载js成功"); var selects = document.querySelectorAll('select[id^="GridView1_dropItem_"]'); console.log(selects); selects.forEach(function(select) { // 遍历每个select中的所有option for (let i = 0; i < select.options.length; i++) { if (select.options[i].value.trim() !== "") { select.selectedIndex = i; // 设置选中第一个非空选项 break; // 找到第一个非空选项后停止循环 } } }); console.log("设置完毕"); // 获取单选按钮元素 var radioButton = document.getElementById('radioSatisfaction_0'); // 检查元素是否存在 if (radioButton) { radioButton.checked = true; // 设置非常称职 } })();