用户名
            密码
                
 
 
    var i = 0;    $(document)            .ready(                    function() {                        $("#newBtn")                                .bind(                                        "click",                                        function() {                                            i++;                                            //alert(i);                                            //alert($("input:checked"));                                            $("#myTable")                                                    .append(                                                            "用户名
密码
");                                            // alert(document.getElementById('sd').value);                                        });                        $("#delBtn").bind(                                "click",                                function() {                                    //alert("删除"+i);                                    //alert($("input:checked"));                                    //$("input:checked").parent().parent().remove();                                    //$("#myTable").remove();                                    //alert($("#myTable input[name=aa]").val());                                    //$("table").remove(tag);                                    $(                                            "#myTable input[name='list[" + i                                                    + "].username']").parent()                                            .parent().remove();                                    if (i >= 0)                                        i--;                                });                    });

后台接收参数

List
 list = null;    public List
 getList() {        return list;    }    public void setList(List
 list) {        this.list = list;    }        if (list != null && !list.equals("")) {            for (Iterator
 iterator = list.iterator(); iterator                    .hasNext();) {                User user = (User) iterator.next();                System.out.println(user.getUsername() + " " + user.getPassword());            }        }