t8cwgw
Last Updated: February 25, 2016
·
612
· eriwen
B668360f53c9975bca11992742e2effe

DOM debugging helper functions

Paste these into your browser JavaScript console for navigating the DOM more quickly while debugging:

function $(id) {
    return document.getElementById(id);
}
function $t(tag, context) {
    return (context || document).getElementsByTagName(tag);
}
function $$(expr, context) {
    return (context || document).querySelectorAll(expr);
}

This works great with Chrome Canary's new Snippets feature.

Say Thanks
Respond