jquery dynamic stracture with Eq
<p>i want to make a single submission with dynamic jquery script but it doesn't worked
what wrong with my code?</p>

<pre><code>$(document).ready(function(){

   $("#foo").each( function( i )
   {

        $("button#foo").eq(i).click(function()
            {
               var a = this.val();
               alert(a);
            });
   });

});

&lt;div id="tabs-1"&gt;&lt;input type="type" value="one"&gt;&lt;button id="foo"&gt;&lt;/button&gt;&lt;/div&gt;

&lt;div id="tabs-2"&gt;&lt;input type="type" value="two"&gt;&lt;button id="foo"&gt;&lt;/button&gt;&lt;/div&gt;

&lt;div id="tabs-3"&gt;&lt;input type="type" value="tree"&gt;&lt;button id="foo"&gt;&lt;/button&gt;&lt;/div&gt;
</code></pre>

<p>thanks mapet</p>
