0
삭제 나는 측의 행을 동적으로마지막 동적으로 생성 된 HTML 행을 생성 JQuery와
var index = 1;
$("#add_field").click(function(){
var new_field = '<tr><th style="text-align: left;">Customer '+index+'</th><td><input type="text" id="customer'+index+'" name="customer'+index+'" maxlength="50"></td><th style="text-align: left;">Phone</th><td><input type="text" id="customerphone'+index+'" name="customerphone'+index+'" maxlength="14"></td><th style="text-align: left;">Email</th><td><input type="text" id="customeremail'+index+'" name="customeremail'+index+'" maxlength="100"></td></tr>';
$("#customerFormTable").append(new_field); });
는 HTML 지금 삭제를 만들려면 어떻게해야합니까
<div id="add_field">Click here to add more rows </div>
을 테이블을 생성
<div id="delete_row">Click here to delete last row created </div>
$("#delete_row").click(function(){ ??????
두 답변 모두에게 감사드립니다. 그들은 그것을 끝내는 것을 도왔다. 여기에 내가 TR을 만들 때 나는 먼저 쓴 것입니다 동적으로 내가 그것에게 ID를 준
관련 문제