Как вставить данные в новую ячейку с помощью js ⇐ Javascript
-
Гость
Как вставить данные в новую ячейку с помощью js
Как вставить данные в новую ячейку с помощью js?
Я пробую это, но не работает.
const input = document.querySelector('.option') console.log(вход) //const id = ele.attributes.name.value //console.dir(ele, id) //Добавляем строку в таблицу const table = document.getElementById(id); const indexRows = table.rows.length; //console.log(таблица); пусть newRow = table.insertRow(-1) пусть newID = newRow.insertCell(0) пусть newDesc = newRow.insertCell(1) пусть newCell1 = newRow.insertCell(2) //пусть newCell2 = newRow.insertCell(3) новыйID.innerHTML = indexRows + 1 newDesc = вход
Как вставить данные в новую ячейку с помощью js?
Я пробую это, но не работает.
const input = document.querySelector('.option') console.log(вход) //const id = ele.attributes.name.value //console.dir(ele, id) //Добавляем строку в таблицу const table = document.getElementById(id); const indexRows = table.rows.length; //console.log(таблица); пусть newRow = table.insertRow(-1) пусть newID = newRow.insertCell(0) пусть newDesc = newRow.insertCell(1) пусть newCell1 = newRow.insertCell(2) //пусть newCell2 = newRow.insertCell(3) новыйID.innerHTML = indexRows + 1 newDesc = вход
Мобильная версия