use setVar() to set the attribute value