SOURCE

console 命令行工具 X clear

                    
>
console
$(function(){
    $('button').click(()=>{

        let name = $('input:eq(0)').val()  
        let cls = $('input:eq(1)').val() 
        let score = $('input:eq(2)').val() 

        let tr = $("<tr><td>1</td><td>" + name + "</td><td>" + cls + "</td><td>" + score +"</td><td>" +
        "<button onclick = 'del(this)'>删除<tton></td></tr>")
        $('tbody').append(tr)
        return false
    })
})
function del(obj){
    console.log('remove')
    $(obj).parent().parent().remove()
}
function getNum(){
    return $('tbody').children().length + 1
}
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<form>
<input placeholder="姓名"/>
<input placeholder="班级"/>
<input placeholder="成绩"/>
<button>添加</button>
</form>
<table border=1 cellspacing=0 cellpadding=5>
<thead>
<tr>
    <th>编号</th>
            <th>姓名</th>
                    <th>班级</th>
                            <th>成绩</th>
                                    <th>操作</th>
</tr>

</thead>
<tbody></tbody>
</table>