title: Implementing Javascript variables into jQuery Method
body: <p>I am trying to implement a for loop into my Javascript/jQuery code, which I <strong>know</strong> works since I did the testing before I implemented the for loop. I found the for loop syntax off of this website: <a href="http://www.w3schools.com/js/js_loop_for.asp" rel="nofollow">http://www.w3schools.com/js/js_loop_for.asp</a> I am not sure how to implement my variable "i" into my for loop within the .css jQuery method. What am I doing wrong? Here is my code:</p>
  
  <pre><code>for(var i=0;i&lt;36;i++) {
      $(".quote_" + i).mouseenter(function(){
          $("td.quote_" + i).css("background-color", "rgb(238, 238, 238)");
      });
      $(".quote_" + i).mouseleave(function(){
          $("td.quote_" + i).css("background-color", "white");
      });
  }
  </code></pre>
  
  <p>This is the code which I <strong>know</strong> works:</p>
  
  <pre><code>$(".quote_1").mouseenter(function(){
          $("td.quote1").css("background-color", "rgb(238, 238, 238)");
      });
      $(".quote_1").mouseleave(function(){
          $("td.quote_1").css("background-color", "white");
      });
  </code></pre>