插入输入框:
$("#tbody").append("<tr>" +
"<td>" +coId + "</td>"+
"<td>" + coName+ "</td>"+
"<td>" + sId+ "</td>"+
"<td>" + sName+ "</td>"+
"<td>" +
"<input type='text' class='inputGrades' ></input>" +
"</td>"+
"</tr>")
获取输入框内容:
function isDelete(){
//删除提醒的提示框
var result = window.confirm("确认提交吗?")
if(result){
let table=document.getElementById("tbody");
let len=table.getElementsByTagName("tr").length;
for(let i=0;i<len;i++)
{
let cId=table.rows[i].cells[0].innerHTML;
let sId=table.rows[i].cells[2].innerHTML;
let grade=table.rows[i].cells[4].children[0].value;
//alert(grade);
$.get("TeacherServlet?method=submitGrade&cId="+cId+"&sId="+sId+"&grade="+grade,function (jsonArray){
$("#tbody").empty();
/*alert(jsonArray)*/
alert("提交成功")
},"json");
}
}else{
}