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.
Written by Eric Wendelin
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Debugging
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#