title: How to Trigger a CSS Animation Using JavaScript?
body: <p>I am trying to run a CSS animation only when the mouse hovers over a certain element. Basically, if a mouse hovers over the parent element <em>container</em>, I want the child element <em>light</em> to run its animation only when it is hovered over. I would like to achieve this with JavaScript/jQuery since I am unsure if this is possible with just CSS alone. I am also new to JavaScript!</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.light {
    position: absolute;
    transform: translate(-200%, 20%);
    width: 4px;
    height: 4px;
    border-radius: 5px;
    background: #0f0;
    filter: hue-rotate(80deg);
    z-index: 2;
    animation: light 1s linear infinite;
  }
  
  @keyframes light {
    *some animation*
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;div class="light"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I am sorry if this is a basic question, but I've research for hours with no success!</p>