1
我有一个表已在两份 按钮和像多个变量和.appendChild(文本)
function insertRow (label) {
var list = document.getElementById('list');
var row = list.insertRow();
var cell1 = row.insertCell(0);
var slash = document.createTextNode('/');
var upButton = document.createElement('button');
var downButton= document.createElement('button');
upButton.innerHTML = "Up";
downButton.innerHTML = "Down";
cell1.style.borderBottom = "2px solid black";
cell1.style.borderLeft = "2px solid black";
cell1.appendChild(upButton);
cell1.appendChild(slash);
cell1.appendChild(downButton);
}
它们之间的斜线这个函数的最后3行做一个细胞我我正在寻找,但对我来说,似乎并不正确的方式来做到这一点。这是我的第一个DOM脚本项目。
***是***正确的方式来做到这一点,做得好! – adeneo
@ adeneo优秀!谢谢 –