我有一个像
这样的 JavaScriptfunction btnclick()
{
\\creating a div dynamically
div[divclick,300,200, 'ok', cancel, btnok_click, btncancel_click]
}
<div style display:none>
<table id = 'tblcontainer'>
<tr>
<td>
add:
</td>
<asp:label id = lblgo>
</asp:label>
</tr>
</table>
现在执行 btnclick 函数。我需要将 tblcontainer 附加到 divclick(动态创建)
最佳答案
您的 javascript 不是真实的,并且您的 html 格式错误,因此我假设它是伪代码。
function btnclick(){
\\creating a div dynamically
var div = document.createElement("DIV");
\\ you can do the other stuff not sure where you got the following...
\\ div[divclick,300,200, 'ok', cancel, btnok_click, btncancel_click]
div.appendChild(document.getElementById('tblcontainer'));
}
<div style display:none>
<table id = 'tblcontainer'>
<tr>
<td>
add:
</td>
<asp:label id = lblgo>
</asp:label>
</tr>
</table>
关于javascript - 使用javascript在div标签中附加表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12594516/