Skip to content

Instantly share code, notes, and snippets.

@amundo
Created February 23, 2015 02:19
poor man's dom selection
function find(selector, scope) {
var matches = (scope || document).querySelectorAll(selector);
if (matches.length == 1) {
return matches
} else {
return [].slice.call(matches)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment