title: How to grab a CSS syntax with JavaScript?
body: <p>Hi guys I have a fadeIn fadeOut transition in CSS. I want to create a variable for <code>animation-duration</code> but I don't know how to grab the whole CSS id and class where I set this. Please have a look over this and let me know if this is possible.</p>
  
  <p>This is my CSS where animation-duration is 8s.</p>
  
  <pre><code>#banner img.top {
    animation-name: bannerFadeInOut;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-duration: 8s;
    animation-direction: alternate;
  }
  </code></pre>
  
  <p>And something like this I want to make in JavaScript</p>
  
  <pre><code>var duration = 4s;
  document.getElementById("banner or whatever needs to be here").style.animationDuration = duration;
  </code></pre>