Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Comparison of the complexity between jQuery and DOM Native syntax required to find all checkboxes in a given page and automatically check them.
// jQuery
$('input[type="checkbox"]').prop('checked',true);
// DOM
Array.prototype.slice.call(document.querySelectorAll('input[type="checkbox"]')).forEach(function(e){e.setAttribute("checked","checked");});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment