Featured image of post 勾選網頁中的所有核取方塊

勾選網頁中的所有核取方塊

要勾選網頁中的所有核取方塊,請按 F12 開啟 DevTools,將以下代碼貼上到主控台並執行。

1
2
3
4
5
6
let boxes = document.querySelectorAll('input[type="checkbox"]');
for (let i = 0; i < boxes.length; i++) {
    if (!boxes[i].disabled) {
        boxes[i].checked = true;
    }
}

或者,

建立一個新書籤,並將以下代碼貼上到註冊網址處(通常是輸入 https://… 的地方)進行註冊。 顯示您想要勾選的網頁,然後點擊已建立的書籤,所有的核取方塊就會被勾選。

1
javascript:(function(){let boxes=document.querySelectorAll('input[type="checkbox"]');for(let i=0;i<boxes.length;i++){if(!boxes[i].disabled){boxes[i].checked=true;}}})();

如果要全部取消勾選,請將上述腳本中的 boxes[i].checked = true; 部分更改為 boxes[i].checked = false;

comments powered by Disqus
使用 Hugo 建立
主題 StackJimmy 設計