jquery dynamic stracture with Eq
Posted
by mapet
on Stack Overflow
See other posts from Stack Overflow
or by mapet
Published on 2010-04-20T09:13:44Z
Indexed on
2010/04/20
9:23 UTC
Read the original article
Hit count: 200
jQuery
i want to make a single submission with dynamic jquery script but it doesn't worked what wrong with my code?
$(document).ready(function(){
$("#foo").each( function( i )
{
$("button#foo").eq(i).click(function()
{
var a = this.value();
alert(a);
});
});
});
<div id="tabs-1"><input type="type" value="one"><button id="foo"></button></div>
<div id="tabs-2"><input type="type" value="two"><button id="foo"></button></div>
<div id="tabs-3"><input type="type" value="tree"><button id="foo"></button></div>
thanks mapet
© Stack Overflow or respective owner