任何人都可以帮助我将JavaScript转换为jQuery吗? JavaScript代码是:JavaScript to jQuery(函数添加行到表)
function addRow()
{
var table = document.getElementById("table2");
var numOfRows = table.rows.length;
var numOfCols = table.rows[numOfRows-1].cells.length;
var newRow = table.insertRow(numOfRows);
for (var j = 0; j < numOfCols; j++) {
newCell = newRow.insertCell(j);
newCell.innerHTML = "add";
}
}
你为什么要把它转换成jQuery? – Cerbrus
重复? http://stackoverflow.com/questions/171027/add-table-row-in-jquery – chris
因为javascript代码应该使用jquery框架来完成... – apolo90