DOM attributes JavaScript module for ender or standalone use
npm install atts --savevar atts = require("atts")- Get or set attributes.
- @return string|
undefined
atts.atts(element)get object containing all attributesatts.atts(element, object)set attributes via object- @return object
- Remove attributes.
- @return
undefined
- Toggle an attribute"s presence and return boolean state.
- @return boolean
- Is attribute
namepresent onelement? -
@return boolean
- Test if
elementsupports an attribute. - @return boolean
- Count or iterate element"s attributes.
- @return number
These exist on atts.prototype and are designed for integration into jQuery-like libs but can also be used via atts.prototype[method].call. Methods are generally compatible with jQuery methods of the same name.
.attr(name, value?).atts(object?).removeAttr(ssv).toggleAttr(name, force?)