title: Thoughts on why an array will not work
body: <p>I am switching classes on the links on my project page, and the class change seems to work when only a single id is used, however when the array "myArray" is used, nothing happens. Curious if anyone has any thoughts why. Here is the code I am working with:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var oldpage = $("#oldpage");
  var phpscript = $("#phpscript");
  var db = $("#db");
  var nypl = $("#nypl");
  var ppt = $("#ppt");
  var myArray = [nypl, db, ppt, phpscript, oldpage];
  $(function() {
    var classes = ["paris", "chateau", "violin", "create", "museum"];
    var id = $(myArray);
    var count = 0;
  
    function nextClass() {
      id.addClass(classes[count = ++count % classes.length]);
      id.removeClass(classes[count = ++count % classes.length]);
      setTimeout(nextClass, 300);
    }
    setTimeout(nextClass, 300);
    id.addClass(classes[0]);
    id.removeClass(classes[0]);
    console.log(id);
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.paris {
    color: pink;
  }
  .violin {
    color: rgb(134, 134, 134);
  }
  .museum {
    color: red;
  }
  .create {
    color: orange;
  }
  .chateau {
    color: green;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;ul id="projects"&gt;
    &lt;li&gt;&lt;a href="http://web.simmons.edu/~duffp/lis489/indexver1.html" target="new" class="violin" id="oldpage"&gt;First iteration of this page&lt;/a&gt;
    &lt;/li&gt;
    &lt;br /&gt;
    &lt;li&gt;&lt;a href="http://web.simmons.edu/~duffp/lis489/php/contactme.txt" target="new" id="phpscript" class="violin"&gt;PHP Mail script attached below.&lt;/a&gt;
    &lt;/li&gt;
    &lt;br /&gt;
    &lt;li&gt;&lt;a href="http://web.simmons.edu/~duffp/lis489/Dufflibrary.php" target="new" id="db" class="violin"&gt;Searchable Database (In progress)&lt;/a&gt;
    &lt;/li&gt;
    &lt;br /&gt;
    &lt;li&gt;&lt;a href="http://web.simmons.edu/~duffp/lis403/Duff_Song_Usability_ppt.ppt" target="new" id="nypl" class="violin"&gt;NYPL Usability Testing&lt;/a&gt;
    &lt;/li&gt;
    &lt;br /&gt;
    &lt;li&gt;&lt;a href="http://web.simmons.edu/~duffp/lis403/Duff_Krim_Song_Evaluation_ppt.ppt" target="new" id="ppt" class="violin"&gt;Evaluation of Online Services&lt;/a&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>