Skip to content

Instantly share code, notes, and snippets.

@dave1010
Created February 16, 2012 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dave1010/1844294 to your computer and use it in GitHub Desktop.
Save dave1010/1844294 to your computer and use it in GitHub Desktop.
jQuery console logger
/*!
* jQuery Console Logger v1.0
*
* Copyright 2012, Dave Hulbert
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Usage: add ".log()" inline in a jQuery chain
* $('div').parent().parent().log().find('span').next().log();
*/
jQuery.fn.log = function() {
console.log(this);
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment