добавить значения в таблицу
имется таблица
<table id="data-table" border="1" cellpadding="10" cellspacing="0"> <thead> <tr> <td> </td> <th scope="col">время(ч)</th> </tr> </thead> <tbody> <tr> <th scope="row">сон</th> <td>5</td> </tr> <tr> <th scope="row">курсовая</th> <td>19</td> </tr> </tbody> и <div id="te"> <div id="newt"> <input type="text" value="" name="taim1"> <input type="text" value="" name="job1"> <input type="button" value="+" id="cop" onclick="addFie()"> <input type="button" value="построить график" id="cop1" onclick="azz()"> </div>с функция которая создает еще input function addFie() { var a=1; var b=1; a++; b++; var p = document.createElement("div"); var k = document.createElement("div"); p.innerHTML = "<input name=\"taim_" +a+ "\" type=\"text\" />" + "<input name=\"job_" +b+ "\" type=\"text\" />"; document.getElementById("newt").appendChild(p); document.getElementById("newt").appendChild(k); } как сделать так чтоб вводим значение в <input type="text" value="" name="taim1"> записывались в новые <td> a <input type="text" value="" name="job1"> в новые <th> соответственно |
Часовой пояс GMT +3, время: 09:52. |