Skip to content

Instantly share code, notes, and snippets.

@asonas
Forked from rosylilly/jquery-tapp.js
Created September 13, 2012 06:49
Show Gist options
  • Save asonas/3712422 to your computer and use it in GitHub Desktop.
Save asonas/3712422 to your computer and use it in GitHub Desktop.
jQuery-tapp
jQuery.fn.extend({
/**
* $('li').tapp() で console.debug に this を出力します。
*
* func を与えることで、func(this) を実行した結果を console.debug に出力します。
*
* @this {jQuery}
* @param {function(jQuery)=} func
* @return {jQuery}
*/
tapp: function(func) {
var _this = this.clone();
console.debug(func ? func.call(_this, _this) : this);
return this;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment