HTML代码:<table id="pixel_canvas"></table>
jS代码:
function makeGrid() {
// Your code goes here!
var cTr_lenght = document.getElementById("input_height").value;
var cTd_lenght = document.getElementById("input_width").value;
var oTab = document.getElementById('pixel_canvas');
for (var i = 0; i <= cTr_lenght-1; i++) {
var cTr = document.createElement('tr');
oTab.appendChild(cTr);
for (var n = 0; n <= cTd_lenght-1; n++) {
var cTd = document.createElement('td');
cTr.appendChild(cTd);
}
}
}
取到输入框的值后点提交,显示一下就没有了。
交互式爱情
相关分类