1
I have an empty table , and then a javascript code that allows you to fill the table through input. What I want is to put all the information of this table in an array (depending on the number of rows and columns in the table) so that later I can eliminate elements in the array and automatically change in the table.
HTML
<input type="text" name="nome" id="nomedisciplina">
<button onclick="adicionar()">Adicionar disciplina</button><br>
JAVASCRIPT
function adicionar() {
var table = document.getElementById("myTable");
var row = table.insertRow(0);
var cell1 = row.insertCell(0);
cell1.innerHTML = document.getElementById("nomedisciplina").value;
}
Have you ever considered using angular or jquery? will make it too easy what you want to do
– Sorack
How would you do in Jquery ?
– Força Chape
You can explain the part better "fill the table by input"? how would that be in practice? put the array in input and the table be changed? on is this array? in code or text/json?
– Sergio
I have an empty table and through the input with id="disciplines" puts this value in the table( table of a column ) , this is the code I already have , now my doubt is how I put the information already present in the table in an array so associate to case later I need to delete in one side delete in another
– Força Chape
You can better explain what you want to do with this array and how changing the array waits for the table to be changed?
– Sergio