|
发表于 2018-9-1 22:29:27
|
显示全部楼层
本帖最后由 xiaoxue 于 2018-9-1 22:36 编辑
7 }! r5 J- c* n- U
7 S, s% b, J. b( D z+ H// ==UserScript==
7 I' Z+ M- W& O. y4 S/ B2 A6 S// @name checkbox
* c1 ^1 y2 E% ^( T( ?6 j// @namespace http://tampermonkey.net/- Q# B; w3 C4 N1 `, K" B
// @version 0.1/ K1 E: `/ V% t
// @description checkbox; |/ Y* J5 |8 O6 H. _. L
// @author checkbox9 F$ D$ Q$ Z; y4 F
// @match */*
; L. S, ^' z' q# b1 T// @grant none7 M& L4 s' P) C
// ==/UserScript==
0 E1 x7 P w; z6 O' q- f' z
" R% K) B8 d* [) F$ t/ L3 @# d(function() {
2 h1 P% e4 h5 `5 a; p! o 'use strict';
0 C1 n" q6 I; i4 e6 k0 ` var xlist = document.getElementsByTagName("input");
+ ?- g" v3 }, e var len = xlist.length;) n2 s Z B# ?
while(len--){
0 i; E/ o( D7 j Z3 N, p$ f if (xlist[len].type == 'checkbox'){. }5 B$ _6 X- c" t3 b9 _1 d
console.log(xlist[len]);
' V( j3 q6 k% G4 S$ k8 y4 a* E$ I xlist[len].checked=true;
( U- w6 l% |4 R' ^) D/ R& n }
( Q8 @5 ~' G' \: B: O }
; P6 y- S& D/ }; o; i7 f) ^; S})();( e: \9 x3 l/ c4 A* E! N# b6 H' m. t
9 }# [- R7 g N6 E# a% U" t; N
0 A/ d7 B( _1 r7 R5 U. w( Otampermonkey 油猴
, t* ]* @% d. m$ \ |
|