$('remove-selected').removeAttribute("disabled"); Array.prototype.forEach.call(document.querySelectorAll("input[type=checkbox]"), function(node) {node.checked = "checked"}); $('remove-selected').click()