|
|
发表于 2018-9-1 22:29:27
|
显示全部楼层
本帖最后由 xiaoxue 于 2018-9-1 22:36 编辑
& h, J' |8 }9 @7 _) q/ r
4 H1 U! ]8 i8 ~& k// ==UserScript==$ T$ s Z2 n. `0 @1 ~
// @name checkbox
; j+ t; X: Z s' b3 x* P// @namespace http://tampermonkey.net// R8 v v5 R- g& P
// @version 0.1
; m+ E3 D7 g5 D9 L// @description checkbox
0 M e3 R" K) a1 ?! g5 v( U) Y, d4 b9 L// @author checkbox/ h5 q% y/ W" X3 K
// @match */*+ r4 r& N" C! j, s$ t8 m& n7 ~
// @grant none3 h+ k* R3 s H& V6 j6 c
// ==/UserScript==
6 H0 J6 k4 ]" c9 u, b+ \" a4 l# R# r$ t2 i% P- n
(function() {( W& f3 q! }( W. r, N
'use strict';
0 `# O, X# W0 B \ var xlist = document.getElementsByTagName("input");
7 E5 }" r: H1 z) M% _ var len = xlist.length;1 }" D8 t( ?% D$ Y5 R7 @
while(len--){; q$ ?/ }( |, [0 c m
if (xlist[len].type == 'checkbox'){
% |1 q) S, L+ E" k console.log(xlist[len]);
1 g2 e5 C6 d& U1 n% |" H- u xlist[len].checked=true;1 }1 n3 s0 ~# ^7 r* Y
}
& U: K+ O% L- ~ }( ]0 f4 d4 {0 d* S! y( Z3 ?2 r
})();/ g4 o9 X2 R# a3 k7 M1 d
. Q' w6 L5 w0 Z3 [) o. _# r( j M! g% Q/ y
tampermonkey 油猴$ G# j k$ y0 r4 `7 H: W
|
|