title: For each array item another background-color on linked page
body: <p>I have created an array with 8 items.  </p>
  
  <p>Now on page 1 I have for each array-item a html link.  Each array-item has a different color.  When clicked on one of the 8 html links it will redirect to page 2. There I want that a div-background gets the color linked to an array item.  </p>
  
  <p>My php-code generates for each array item a classname: <code>.feeling1, .feeling2, .feeling3, .feeling4, .feeling5, ...</code>
  Now this seemed easy by simply saying when clicked on an element with class name (for example) <code>.feeling1</code> then change the <code>background-color</code> of the div (<code>id="resultaat"</code>) on page 2.  But apparently this code won't work... </p>
  
  <p>Anyone a solution for this?  Thanks in Advance.</p>
  
  <p>Example of one array item:</p>
  
  <pre><code>        [
          "mood" =&gt; "social",
          "number"=&gt;"feeling4",
          "name"=&gt;"DOK FLEA MARKET",
          "picture" =&gt; "images/treasures/social.png",
          "about" =&gt; "Every Sunday till the end of September there's a flea  market full with people selling their odds and ends, homemade stuff and art ",
          "street"=&gt;"Koopvaardijlaan 4",
           "city"=&gt;"GHENT",
          "days"=&gt;"opening days: Sunday",
          "hours"=&gt;"opening hours: 10:00AM-6:00PM "
  
          ],
  </code></pre>
  
  <p>Page 1:</p>
  
  <pre><code>&lt;body&gt;
  &lt;!--CONTAINER--&gt;
  &lt;div id="container"&gt;
  
      &lt;!--HEADER--&gt;
      &lt;header&gt;
          &lt;h1 id="headertitel"&gt;PICK YOUR MOOD&lt;/h1&gt;
      &lt;/header&gt;
  
      &lt;!--SECTION--&gt;
      &lt;section id="middenstuk"&gt;
  
          &lt;ul class="list"&gt;
  
              &lt;?php foreach ($arr_artist as $key=&gt; $artist) { echo "
              &lt;li class='".$artist[' number ']."'&gt;&lt;a href='3.php?id=".$key."' class='feeling".$artist[' mood '].", trala'&gt;".$artist['mood']."&lt;/a&gt;
              &lt;/li&gt;"; } ?&gt;
  
          &lt;/ul&gt;
  
          &lt;script&gt;
              $(".feeling").mousedown(function () {
                  $(this).addClass('slideright');
              });
          &lt;/script&gt;
  
      &lt;/section&gt;
  
      &lt;!-- FOOTER --&gt;
      &lt;footer&gt;
  
          &lt;a class="linkhome1" href="4.php"&gt;
              &lt;div class="locatie"&gt;&lt;/div&gt;
          &lt;/a&gt;
          &lt;a class="linkhome1" href="index.php"&gt;
              &lt;div class="home"&gt;&lt;/div&gt;
          &lt;/a&gt;
  
      &lt;/footer&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>The Jquery code:</p>
  
  <pre><code>  $(".feeling2").click(function () {
        $("#resultaat").css("background-color", "red");                      
    });
  </code></pre>