解决方案 »
- JS初级问题,输入的值在另一个页面被获取(不用jQuery实现)
- 一段JS代码在本地运行正常,服务器上就不行,求教,谢谢谢谢
- 急救:关于jquery插件jquery-jtemplates.js和thickbox.js混用的问题..
- js中的window.scroll与 window.scrollTo 两者是啥关系, 有啥区别?
- 够刺激的课题!大家快来看看!
- 下拉菜单显示的问题
- 如何用javascript实现IE F5刷新功能?
- 我由客户端从服务器上下载一个名称是中文的EXCEL表,可下载时表的名称是乱码?如何设置?
- jsp中检验方法不生效
- 求大神看看这个Ajax动态去数据库获取值的代码,为什么进不了Action里面
- 定义全局函数并调用问题
- EXTJS PagingToolbar 这个传输到后台是start limit 然后后台进行计算。
document.getElementById("dd").innerHTML=" 把你那段table代码加到这里";
}
<td align="right"><label>材质:</label></td>
<td align="left">
<div class="button-holder">
<input type="radio" id="radio-1-1" name="radio-1-set" class="regular-radio big-radio" checked />
<label for="radio-1-1">全部</label>
<input type="radio" id="radio-1-2"name="radio-1-set" class="regular-radio big-radio" />
<label for="radio-1-2">钢质</label>
<input type="radio" id="radio-1-3" name="radio-1-set" class="regular-radio big-radio" />
<label for="radio-1-3">不锈钢</label>
</div>
</td>
</tr>";
$(html).appendTo(table);
然后就是清楚表述你的需求。下面代码可以操作table,插入新行。
var tableRef = document.getElementById('myTable').getElementsByTagName('tbody')[0];// Insert a row in the table at the last row
var newRow = tableRef.insertRow(tableRef.rows.length);// Insert a cell in the row at index 0
var newCell = newRow.insertCell(0);// Append a text node to the cell
var newText = document.createTextNode('New row')
newCell.appendChild(newText);
<html>
<head>
<script language=javascript>
function addRow(){
var f = document.forms['formTest'];
var input = document.createElement('input');
input.setAttribute("type","file");
input.setAttribute("size","30");
input.setAttribute("name","test");
f.appendChild(input);
var br = document.createElement('br');
f.appendChild(br);
}
</script>
</head>
</body>
<form name=formTest action="FileUploadServlet" method="post"
enctype="multipart/form-data">
<input name="up" type="submit" value="上传" />
<button type="button" onclick='addRow();'>加入一行</button><br/>
<input type="file" size="30" name="test" />
<br />
</form>
</body>
</html>