Revision control

1
<!DOCTYPE html>
2
<body>
3
<style>
4
5
@keyframes anim {
6
from { margin-left: 0 }
7
to { margin-left: 100px }
8
}
9
10
</style>
11
<script>
12
13
const target = document.body.appendChild(document.createElement("div"));
14
target.style.animation = "anim 1s";
15
const animation = target.getAnimations()[0];
16
17
animation.effect = new KeyframeEffect(animation.effect);
18
animation.effect.target = document.createElement("div");
19
20
target.style.animation = "none";
21
target.getAnimations();
22
23
target.remove();
24
25
</script>
26
</body>