attr

  • function
 

Keep an attribute live to a can.compute.

live.attr(el, attributeName, compute)

Keep an attribute live to a can.compute.

Parameters

  1. el {HTMLElement}

    The element whos attribute will be kept live.

  2. attributeName {String}

    The attribute name.

  3. compute {can.compute(getterSetter, context)}

    The compute.

Use

var div = document.createElement('div');
var compute = can.compute("foo bar");
can.view.live.attr(div,"class", compute);