From 3800d177030d20c5c3d04e3601f892c46e723dc2 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 16 Sep 2011 00:56:19 +0200 Subject: feat(jqLite): add prop() support since jQuery 1.6.4 prop() became very important because attr() does't have access to certain properties any more (e.g. className), so I'm adding it to jqLite as well so that jqLite preserves the feature-set it had before the jQuery upgrade. --- src/jqLite.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/jqLite.js b/src/jqLite.js index 6d42bbc2..d7faa1e8 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -40,6 +40,7 @@ * - [eq()](http://api.jquery.com/eq/) * - [hasClass()](http://api.jquery.com/hasClass/) * - [parent()](http://api.jquery.com/parent/) + * - [prop()](http://api.jquery.com/prop/) * - [remove()](http://api.jquery.com/remove/) * - [removeAttr()](http://api.jquery.com/removeAttr/) * - [removeClass()](http://api.jquery.com/removeClass/) @@ -287,6 +288,14 @@ forEach({ } }, + prop: function(element, name, value) { + if (isDefined(value)) { + element[name] = value; + } else { + return element[name]; + } + }, + text: extend((msie < 9) ? function(element, value) { // NodeType == 3 is text node -- cgit v1.2.3