这是布局
页面
添加表格
想要在点击提交按钮后,alert弹出最后一行的用户名 input中输入的值 (现在只能通过id 获取第一行的值)
这是布局
页面
添加表格
想要在点击提交按钮后,alert弹出最后一行的用户名 input中输入的值 (现在只能通过id 获取第一行的值)
//最后一行第1个input
document.querySelector("#testTb1 tr:last-of-type input:first-of-type").value
//最后一行第n个input
document.querySelector("#testTb1 tr:last-of-type input:nth-of-type(n)").value