var validateForm = null;
var num = ;
$(document)ready(function(){
var lastCommunAddTr = $("#workDay");
$("#add")click(function() {
//復制一行
var tr = $("#workDay")clone();
trfind("#dayMsg")get()styledisplay="none";
trfind("#remarkMsg")get()styledisplay="none";
trfind("#msg")get()styledisplay="none";
trfind("#day")get()value="";
trfind("#dayMsg")get()id="dayMsg"+num;
trfind("#day")get()id="day"+num;
trfind("#msg")get()id="msg"+num;
trfind("#remark")get()value="春節";
trfind("#state")get()id="state"+num;
trfind("#remark")get()id="remark"+num;
trfind("#remarkMsg")get()id="remarkMsg"+num;
trshow();
trinsertAfter(lastCommunAddTr);
lastCommunAddTr = tr;
num++;
});
//刪除一行
$("#workDayDel")click(function() {
var delIndexs = new Array();
$("trWorkDay:gt()")each(function(i) {
if($(this)find("#ck")get()checked == true){
delIndexssplice(delIndexslengthi);
$(this)remove();
}
$("trWorkDay")each(function() {
lastCommunAddTr = $(this);
});
});
});
});
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19982.html