Comparing version
@@ -61,2 +61,6 @@ class El { | ||
if (value === false) { | ||
return this.$el.removeAttribute(attrName) | ||
} | ||
this.$el.setAttribute(attrName, value) | ||
@@ -63,0 +67,0 @@ return this |
{ | ||
"name": "eldo", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Tiny chainable DOM manipulation lib.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -150,2 +150,20 @@ # el.js | ||
### Get attribute | ||
`$myEl.attr('data-id')` | ||
Returns value for attribute `data-id`. | ||
### Set attribute | ||
`$myEl.attr('data-id', 42)` | ||
Sets attribute `data-id` to `42`. | ||
### Remove attribute | ||
`$myEl.attr('data-id', false)` | ||
Removes attribute `data-id` from element. | ||
### Add class to element | ||
@@ -152,0 +170,0 @@ |
10547
3.39%160
1.91%354
5.36%