Skip to content

Instantly share code, notes, and snippets.

@toshimaru
Last active December 14, 2015 16:28
Show Gist options
  • Save toshimaru/5114828 to your computer and use it in GitHub Desktop.
Save toshimaru/5114828 to your computer and use it in GitHub Desktop.
$.fn.trace = function (ident) {
var c = window.console;
var arg = [this];
if (ident) {
arg.unshift(ident);
};
(c.debug || c.log).apply(c, arg);
return this;
}

Usage

 $('#id').trace()
  .find('.class').trace();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment