title: Comparing values of 2 dimensional array to single dimensional array
body: <p>I am creating a trivia game for a class and I am struggling to compare all of the values of a single index of a 2-dimensional array to a single value of a single index of another array. From my limited experience, I am using and if statement to compare these values. I must be missing a step but I am unsure how to solve it. The line of code for which I think the mistake lies is <code>$(".choice").on('click', function() {});</code></p>
  
  <p>Thank you for any help in advanced.</p>
  
  <p>JS: </p>
  
  <pre><code>window.onload = function() {
      $('#start').html('&lt;div class="text-center"&gt;&lt;button type="button" class="btn btn-default"&gt;Start&lt;/button&gt;&lt;/div&gt;');
  };
  
  var questionArray = ["This bands second album went platinum 5 times in the UK and double Platinum in the US.", "This band was formed in Australia and their first album, which had you Walking On A Dream, has sold over 3 million copies."];
  var optionArray = [["Radio Head", "Gorillaz", "Coldplay", "Arctic Monkeys"], ["Empire Of The Sun", "M83", "MGMT", "Two Door Cinema Club"]];
  var answerArray= ["Gorillaz", "Empire Of The Sun"];
  var imageArray= ["http://cdn3.pitchfork.com/artists/1767/m.65d9c64d.jpg", "http://crowningmusic.com/storage/rA7GUFFoBCtT8Jg4L1tv.png", "", "", ""];
  
  var count = 0;
  var question = 0;
  
  $("#start").on('click', function() {
  
      $(this).css("display","none");
  
      timer(
          30000,
          function(timeleft) { 
              $('#timer').html(timeleft);
          },
          function() { 
              // What happens after //
          }
      );
  
      $("#question").html(questionArray[question]);
          for (var j = 0; j &lt; 4; j++) {
              $("#options").append('&lt;button class="choice"&gt;' + optionArray[question][j] + "&lt;/button&gt;" + "&lt;br&gt;");
          }
  
      $(".choice").on('click', function() {
          console.log('click');
          console.log(answerArray[question])
          if (optionArray[question] == answerArray[question]) {
              console.log("Working");
          }
      });
      // $("#holder").html("&lt;img src=" + questionArray[count] + "&gt;");
  });
  
  function nextQuestion() {
      count++;
  }
  
  // Timer Function //
  function timer(time,update,complete) {
      var start = new Date().getTime();
      var interval = setInterval(function() {
          var now = time-(new Date().getTime()-start);
          if( now &lt;= 0) {
              clearInterval(interval);
              complete();
          }
          else update(Math.floor(now/1000));
      },100); // the smaller this number, the more accurate the timer will be
  }
  </code></pre>