title: Jquery eq(i) doesnt work - How can i do in a "for"?
body: <p>This code below works fine when i put a number after my eq.</p>
  <pre><code> for (i=0; i&lt;$(&quot;button.mark&quot;).length ; i++){
  
     $(&quot;button.mark:eq(0)&quot;).on(&quot;click&quot;, e =&gt; {
       e.preventDefault()
       e.stopPropagation()
       $(&quot;div.popup:eq(0)&quot;).show()
    
        if ($(&quot;div.popup:eq(0)&quot;).css(&quot;display&quot;) === &quot;block&quot;) {
          $(window).on(&quot;click&quot;, () =&gt; {
            $(&quot;div.popup:eq(0)&quot;).hide()
          })
        }
     })
   }
  </code></pre>
  <p>but it stop working when i try to put it in the for with i.
  Do you know why ?</p>
  <pre><code>for (i=0; i&lt;$(&quot;button.mark&quot;).length ; i++){
  
     $(&quot;button.mark:eq(i)&quot;).on(&quot;click&quot;, e =&gt; {
       e.preventDefault()
       e.stopPropagation()
       $(&quot;div.popup:eq(i)&quot;).show()
    
        if ($(&quot;div.popup:eq(i)&quot;).css(&quot;display&quot;) === &quot;block&quot;) {
          $(window).on(&quot;click&quot;, () =&gt; {
            $(&quot;div.popup:eq(i)&quot;).hide()
          })
        }
     })
   }
  </code></pre>