title: Check if ID from array has class
body: <p>i have a windows like interface and when u click a desktop icon, a windows (set to display: hidden;) gets the class "visible".</p>
  
  <pre><code>.visible {
      display: initial !important;
  }
  </code></pre>
  
  <p>i have multiple desktop icons, and multiple windows.
  There is also a taskbar, with the same icons. i want these to be highlighted when the corresponding windows is set to "visible".</p>
  
  <pre><code>.taskbar_icon.hover {
      background: #9a3233;
      transition: all 300ms ease-in-out;
  }
  </code></pre>
  
  <p>the way i wanted to do this is by putting the IDs of the windows in an array. 
  then check if any of those windows have the class "visible". 
  and if they do, add a class of "hover" to the corresponding taskbar icon.</p>
  
  <p>this is what i got so far.</p>
  
  <p>Jquery :</p>
  
  <pre><code>window.setInterval(function () {
  var windows = ["#explorer", "#chrome", "#txt_editor"];
  console.log(windows);
      if ( $(windows).hasClass('visible') ) {
          $(this + '_taskbar').addClass('hover');
      }
      else {
          $(this + '_taskbar').removeClass('hover');
      };
  }, 100);
  </code></pre>
  
  <p>HTML :
  Desktop icon</p>
  
  <pre><code>&lt;div id="desktop"&gt;
          &lt;a href="#_" target="#explorer" class="desktop_icon"&gt;&lt;img src="img/icons/folder.png"&gt;&lt;/a&gt;
          &lt;a href="#_" target="#chrome" class="desktop_icon"&gt;&lt;img src="img/icons/chrome.png"&gt;&lt;/a&gt;
          &lt;a href="#_" target="#txt_editor" class="desktop_icon"&gt;&lt;img src="img/icons/word.png"&gt;&lt;/a&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Windows</p>
  
  <pre><code>&lt;div id="explorer" class="window"&gt;&lt;/div&gt;
  &lt;div id="chrome" class="window"&gt;&lt;/div&gt;
  &lt;div id="txt_editor" class="window"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Taskbar</p>
  
  <pre><code>&lt;div id="taksbar"&gt;
              &lt;ul&gt;
                  &lt;li&gt;&lt;a href="#_" target="#explorer" id="explorer_taskbar" class=" taskbar_icon"&gt;&lt;img src="img/icons/folder_taskbar.png"&gt;&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#_" target="#chrome" id="chrome_taskbar" class=" taskbar_icon"&gt;&lt;img src="img/icons/chrome.png"&gt;&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#_" target="#txt_editor" id="txt_editor_taskbar" class=" taskbar_icon"&gt;&lt;img src="img/icons/word_taskbar.png"&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
  </code></pre>