0
var cell_masuk = newRow.insertCell(5);
var newText = document.createTextNode(document.getElementById("tanggal_masuk").value);
cell_masuk.appendChild(newText);
var cell_exp = newRow.insertCell(6);
var newText = document.createTextNode(document.getElementById("tanggal_kadaluarsa").value);
cell_exp.appendChild(newText);
var cell_btn = newRow.insertCell(7);
var newText = document.createTextNode("<input type='button' class='button' value='x'>");
cell_btn.appendChild(newText);
從上面的代碼我想插入新的表格行上的按鈕。但是,當我使用此代碼:我如何添加一行按鈕與「document.createTextNode」
var cell_btn = newRow.insertCell(7);
var newText = document.createTextNode("<input type='button' class='button' value='x'>");
cell_btn.appendChild(newText);
我的表上的結果始終是字符串。 對不起,我的英語不好,即時通訊新的Web開發。
你打我吧。 +1 –
@ T.J。 Crowder,我嘗試用input.onClick = DeleteRow(index)在按鈕 上添加'onClick';但它不工作,你能告訴我正確的語法嗎?謝謝:) – Sebastian