carry
Carry attrs, classes from one element to another.
Last updated 5 years ago by defunctzombie .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install carry 
SYNC missed versions from official npm registry.

carry

Carry attrs, classes from one element to another.

Installation

Install with component(1):

$ component install yields/carry

Example


function Widget(el){
  this.el = carry(el, tpl.cloneNode());
}

new Widget;
new Widget(el);

API

carry(a, b)

if a is null a clone of b will be returned. otherwise b's attrs and classes are merged with a, returning a.

.attrs(a, b)

Carry over attributes from b to a.

.classes(a, b)

Carry over classes from b to a.

License

MIT

Current Tags

  • 0.0.4                                ...           latest (5 years ago)

4 Versions

  • 0.0.4                                ...           5 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 7
Dependencies (2)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |