attr
live.attr(el, attributeName, observable)
Keep an attribute live to a can-reflect-ed observable.
var div = document.createElement('div');
var value = new SimpleObservable("foo bar");
live.attr(div,"class", value);
Parameters
- el
{HTMLElement}
:The element whos attribute will be kept live.
- attributeName
{String}
:The attribute name.
- observable
{Object}
:An observable value.
How it works
This listens for the changes in the observable and uses those changes to set the specified attribute.