updating attributes works as expected

need val() not attr('value')