title: Constantly check when a CSS class is added
body: <p>I'm trying to display an element when a video is paused.
  I'm using video.js, and currently, classes are added if the video is played, paused, finished etc.</p>
  
  <p>What I can't do is to check using .hasClass() and display the element.
  So far I'm using this:</p>
  
  <pre><code> if ($('.video-js').hasClass('vjs-paused')) {
      $('.btn').addClass('show');}
      else {
        $('.btn').removeClass('show');
  
      }
  </code></pre>
  
  <p>I guess I need to check any changes constantly but i don't really know how to do it.</p>
  
  <p>I've also seen a plugin called watch but not sure how to use it.</p>
  
  <p>This is a codepen:</p>
  
  <p><a href="https://codepen.io/florinsimion/pen/wWjxzA" rel="nofollow">https://codepen.io/florinsimion/pen/wWjxzA</a></p>