Skip to content

Instantly share code, notes, and snippets.

@rahman541
Last active April 25, 2016 15:20
Show Gist options
  • Save rahman541/3e7fb47ddb4041cf7f17b575536da933 to your computer and use it in GitHub Desktop.
Save rahman541/3e7fb47ddb4041cf7f17b575536da933 to your computer and use it in GitHub Desktop.
Select all visible checkbox in a webpage

Select all visible checkbox in page via console


tested in chrome only

open chrome > open Inspect Element or press F12 in page you want to select visible checkbox. Then paste this code to Console tab.

var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; ++i) {
  if (inputs[i].type == "checkbox"){
    inputs[i].checked = true;
  }
}
document.getElementById("remove-selected").disabled = false

REF: http://superuser.com/a/791728/443106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment