동적 jquery 스크립트로 단일 제출을 만들고 싶지만 작동하지 않습니다. 코드에 어떤 문제가 있습니까?jquery dynamic stracture with Equq
$(document).ready(function(){
$("#foo").each(function(i)
{
$("button#foo").eq(i).click(function()
{
var a = this.val();
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>
덕분에 문제는 당신이 ID를 반복되어있다
IDS 모든 요소에서 고유해야 –