大佬教程收集整理的这篇文章主要介绍了javascript – 使用jQuery动态地向表中添加行和列,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
function addRow@R_85_10586@ble() { var tbl = document.getElementById('tblSample'); var lastRow = tbl.rows.length; // if there's no header row in the table,then iteration = lastRow + 1 var iteration = lastRow; var row = tbl.insertRow(lastRow); // left cell var cellLeft = row.insertCell(0); var textNode = document.createTextNode(iteration); cellLeft.appendChild(textNodE); // right cell var cellRight = row.insertCell(1); var el = document.createElement('input'); el.type = 'text'; el.name = 'txtRow' + iteration; el.id = 'txtRow' + iteration; el.size = 40; el.onkeypress = keyPressTest; cellRight.appendChild(el); // SELEct cell var cellRightSel = row.insertCell(2); var sel = document.createElement('SELEct'); sel.name = 'selRow' + iteration; sel.options[0] = new Option('text zero','value0'); sel.options[1] = new Option('text one','value1'); cellRightSel.appendChild(sel); }
以上是大佬教程为你收集整理的javascript – 使用jQuery动态地向表中添加行和列全部内容,希望文章能够帮你解决javascript – 使用jQuery动态地向表中添加行和列所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。