Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Small optimizations

  • Loading branch information...
commit 24707249ee2d20020040277d4a2cd6bef78d35a1 1 parent e525efd
@mathiasbynens authored
Showing with 4 additions and 6 deletions.
  1. +3 −5 jquery.dataAttr.js
  2. +1 −1  jquery.dataAttr.min.js
View
8 jquery.dataAttr.js
@@ -4,8 +4,6 @@
* @description An easy setter/getter for HTML5 data-* attributes
* @author Mathias Bynens <http://mathiasbynens.be/>
*/
-;(function($) {
- $.fn.dataAttr = function(attr, val) {
- return val ? this.attr('data-' + attr, val) : this.attr('data-' + attr);
- };
-})(jQuery);
+jQuery.fn.dataAttr = function(attr, val) {
+ return val ? this.attr('data-' + attr, val) : this.attr('data-' + attr);
+};
View
2  jquery.dataAttr.min.js
@@ -4,4 +4,4 @@
* @description An easy setter/getter for HTML5 data-* attributes
* @author Mathias Bynens <http://mathiasbynens.be/>
*/
-(function(a){a.fn.dataAttr=function(b,c){return c?this.attr('data-'+b,c):this.attr('data-'+b)}})(jQuery);
+jQuery.fn.dataAttr=function(a,v){return v?this.attr('data-'+a,v):this.attr('data-'+a)};
Please sign in to comment.
Something went wrong with that request. Please try again.