To copy the new value of a data attribute, use JavaScript’s dataset property. Access it with element.dataset.attributeName after updating, then store or use it as needed.