title: Jquery issue with the loop
body: <pre><code>var length=$('div p').length;
  
  for(var i=0; i&lt;length; i++) {
  
  if(i==5) {
  
    do something
  
  }
  }
  </code></pre>
  
  <p>Im triying to loop though a div and start from the first(0 index) element and when the loop reaches the 5th index i want it to do something. My question is, is the code right and if not where are my errors</p>