Check out the following code snippet:
.startanimation {
height: 100px;
width: 100px;
background: yellow;
-webkit-animation: animate 1s infinite;
}
@-webkit-keyframes animate {
100% {
width: 300px;
height: 300px;
}
}
When applying the "startanimation" class directly in HTML, the animation works fine. However, when using the "addClass" method to add the same class to another element dynamically, the animation fails to work. Any suggestions on how to resolve this issue?