📜  js 启动 css 动画 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:10.700000             🧑  作者: Mango

代码示例1
const element = document.querySelector(".yourElementClass");
const btn = document.querySelector(".yourButtonClass");

btn.onclick = () => {
  element.style.animation = "YourAnimation 1s linear infinite"
}
// you will need js to start an animation, Don't forget to declare it using css