Update element when replaced.