Skip to content

Commit

Permalink
Added super simple .data() method
Browse files Browse the repository at this point in the history
  • Loading branch information
errorhandler committed Feb 19, 2011
1 parent f4e92d3 commit 0a5a503
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/zepto.js
Expand Up @@ -128,6 +128,9 @@ var Zepto = (function() {
removeAttr: function(name) {
return this.each(function() { this.removeAttribute(name); });
},
data: function(name, value){
return this.attr('data-' + name, value);
},
val: function(value){
return (value === undefined) ?
(this.length > 0 ? this[0].value : null) :
Expand Down

0 comments on commit 0a5a503

Please sign in to comment.