@@ -1,13 +1,13 @@ /* - * @title ~☑ - * @description Toggle checkbox all + * @title ☑ + * @description Check checkbox all * @include http://* * @license MIT License http://nrm.mit-license.org/2012 * @require */ (function () { - Array.prototype.slice.call(document.querySelectorAll('input[type=checkbox]')).forEach(function (box) { - box.checked = !box.checked; + Array.prototype.slice.call(document.querySelectorAll('input[type=checkbox]:not(:checked)')).forEach(function (box) { + box.checked = true; }); -})(); +})();
  • /*
     * @title ☑
     * @description Check checkbox all
     * @include http://*
     * @license MIT License http://nrm.mit-license.org/2012
     * @require 
     */
    
    (function () {
        Array.prototype.slice.call(document.querySelectorAll('input[type=checkbox]:not(:checked)')).forEach(function (box) {
            box.checked = true;
        });
    })();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2012/10/26 01:59:01 - 2012-10-26
  2. 2012/10/26 01:43:13 - 2012-10-26