记一次无聊的视力测试

http://www.lezyo.com/special/game/color/?from=singlemessage&isappinstalled=

Chrome:

F12-Console输入

setInterval(function () {
var first = '';
var firstCount = 0;
var firstIndex = 0;

var second = '';
var secondCount = 0;
var secondIndex = 0;
$("#box").children("span").each(function (i) {
if (i == 0) {
first = $(this).css("background-color");
firstIndex = i;
firstCount++;
return;
}

if (first == $(this).css("background-color")) {
firstIndex = i;
firstCount++;
} else {
second == $(this).css("background-color");
secondIndex = i;
second++;
}
});
if (firstCount == 1) {
$("#box").children("span").eq(firstIndex).click();
} else {
$("#box").children("span").eq(secondIndex).click();
}
}, 1);
原文地址:https://www.cnblogs.com/shenqiboy/p/4673852.html