title: loop into js object
body: <p>i have this js object:</p>
  
  <pre><code>var tags = [{ 'x' : '42','y' : '25','id' : '1', 'linea' : '1'},{ 'x' : '378','y' : '24','id' : '2', 'linea' : '1'}];
  </code></pre>
  
  <p>i try to loop in this way:</p>
  
  <pre><code>for(var i = 0; i &lt; tags.length; i++){
  
              var x = tags[i].x -10;
              var y = tags[i].y -10;
  
  
              var offsetX = x + 20;
              var offsetY = y + 20;
  
  
              if( left &gt;= x &amp;&amp; left &lt;= offsetX ){ 
  
                  $(myDiv).bind('click',function(){
                      document.location.href = 'x.php?a='+ tags[i].linea +'&amp;b=' + tags[i].id;
                  }).css('cursor','pointer');
  
              }else{
                  $(myDiv).unbind('click').css('cursor','none');
              }
          }
  </code></pre>
  
  <p>But i loose the first! 
  Is this the correcy way??
  Thanks!</p>