Skip to content

Instantly share code, notes, and snippets.

@patrickmaciel
Created April 12, 2016 17:31
Show Gist options
  • Save patrickmaciel/25c52acbc9b52de7ac40d8d08cdb4f1e to your computer and use it in GitHub Desktop.
Save patrickmaciel/25c52acbc9b52de7ac40d8d08cdb4f1e to your computer and use it in GitHub Desktop.
Get checked inputs and then checked the new inputs
HTML.query('input[checked=checked]').each(function(el, li, all) {
console.log(el.value);
});
var itens = [1, 270, 327, 112, 111, 107, 293, 328, 110, 326, 175, 174, 289, 286, 291, 288, 285, 290, 170, 294, 312, 173, 261, 318, 325, 80, 85, 83, 79, 81, 311, 82, 296, 224, 220, 225, 223, 219, 231, 227, 232, 230, 226, 228, 229, 221, 222, 238, 234, 239, 237, 233, 245, 241, 246, 244, 240, 242, 243, 297, 235, 236, 252, 248, 253, 251, 247, 298, 259, 255, 260, 258, 254, 256, 257, 249, 250, 303, 299, 302, 304, 306, 300, 305, 307, 309, 301, 308, 310, 292, 262, 295, 316, 315];
$.each(itens, function(index, value) {
$('input[value=' + value +']').attr('checked', 'checked');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment