Skip to content

Commit

Permalink
Added removeAttribute method to Element
Browse files Browse the repository at this point in the history
  • Loading branch information
etler committed May 24, 2014
1 parent b9ab00d commit 9aaf01a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/DOM/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ Element = (function () {
});
};

Element.prototype.removeAttribute = function (key) {
var attribute, index;
key = attributeString(key);
for (index = 0; index < this.attributes.length; index++) {
attribute = this.attributes[index];
if (attribute.name === key){
this.attributes.splice(index, 1);
return;
}
}
};

Element.prototype.getElementsByClassName = function (string) {
var child, index, childClassName, classes, hasClasses, matches;
hasClasses = function (childClasses, matchClasses) {
Expand Down

0 comments on commit 9aaf01a

Please sign in to comment.