Carry attrs, classes from one element to another.
Install with component(1):
$ component install yields/carry
function Widget(el){
this.el = carry(el, tpl.cloneNode());
}
new Widget;
new Widget(el);
if a
is null
a clone of b
will be returned.
otherwise b
's attrs and classes are merged with a
,
returning a
.
Carry over attributes from b
to a
.
Carry over classes from b
to a
.
MIT