b.udy.js :dog2:
A micro DOM library! With only one purpose: facilitate the creation and manipulation of DOM elements.
npm install b.udy.js
basic usage
var b = require('b.udy');
var element = b('div').element();
b(element);
b(element).id('element-id');
b(element).className('element-class other-element-class');
b(element).attr('data-type', 'div');
b(element).removeAttr('data-type', 'div');
b(element).listener('click', clickListener);
b(element).removeListener('click', clickListener);
b(element).id('element').className('element-class').listener('click', clickListener);
methods
- b**(nodeType | element)**: Create or load a DOM element;
- b.element(): Return the DOM element;
- b.id(value): Set the DOM element id;
- b.className(value): Set the DOM element className;
- b.attr(key, value): Add a attribute to the DOM element;
- b.removeAttr(key): Remove a attribute from the DOM element;
- b.listener(eventType, callback): Add a event listener to the DOM element;
- b.removeListener(eventType, callback): Remove a event listener from the DOM element;
support
- chrome: latest;
- firefox: latest;
- safari: latest;
- internet explore: 9+;
contribute
Everyone can contribute! Finding bugs, creating issues, improving documentation, improving editor it self or creating components.
Every contribution will be welcomed! :santa:
Fork it -> Branch it -> Test it -> Push it -> Pull Request it