From 0a5a503dfaf6e594771335fcfdb4ba220bd4deb8 Mon Sep 17 00:00:00 2001 From: errorhandler Date: Sat, 19 Feb 2011 17:20:48 +1300 Subject: [PATCH] Added super simple .data() method --- src/zepto.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/zepto.js b/src/zepto.js index 420ba0a33..fdb0df912 100644 --- a/src/zepto.js +++ b/src/zepto.js @@ -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) :