Permalink
Browse files

fixes removing all aria attrs

  • Loading branch information...
1 parent c14bef4 commit 3fcf748955289536df194eca7cf6b794e143c34b @AaronLasseigne AaronLasseigne committed Apr 18, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/jquery.aria.js
View
@@ -31,7 +31,7 @@
elem = $(elem);
if (key === undefined && value === undefined) {
- attributes = {};
+ var attributes = {};
$.each(elem[0].attributes, function(i, value) {
if (value.nodeName.match(/^aria-/)) {
attributes[value.nodeName.replace(/^aria-/, '')] = value.nodeValue;
@@ -48,10 +48,8 @@
elem = $(elem);
if (key === undefined) {
- $.each(elem[0].attributes, function(i, value) {
- if (value.nodeName.match(/^aria-/)) {
- elem.removeAttr('aria-' + value.nodeName.replace(/^aria-/, ''));
- }
+ $.each(elem.aria(), function(key, value) {
+ elem.removeAttr('aria-' + key);
});
return elem;

0 comments on commit 3fcf748

Please sign in to comment.