Replace a given value of an attribute with a new value