ASP 点击按钮复制表格中的内容
要实现点击按钮就复制标题下的内容,绑定ASP动态数据时也要有这个功能,谢谢各位<tablewidth="750"border="0"cellpadding="5"><tr...
要实现点击按钮就复制标题下的内容,绑定ASP动态数据时也要有这个功能,谢谢各位
<table width="750" border="0" cellpadding="5">
<tr>
<td colspan="4"><label>
<input type="submit" name="button" id="button" value="Copy" />
</label></td>
</tr>
<tr>
<td>标题</td>
<td>标题</td>
<td>标题</td>
<td>标题</td>
</tr>
<tr>
<td>XXX</td>
<td>XXXXX</td>
<td>XXXX</td>
<td>XXX</td>
</tr>
<tr>
<td>XXXXXX</td>
<td>XXXXXXX</td>
<td>XXXXXXX</td>
<td>XXXXXXXXX</td>
</tr>
</table> 展开
<table width="750" border="0" cellpadding="5">
<tr>
<td colspan="4"><label>
<input type="submit" name="button" id="button" value="Copy" />
</label></td>
</tr>
<tr>
<td>标题</td>
<td>标题</td>
<td>标题</td>
<td>标题</td>
</tr>
<tr>
<td>XXX</td>
<td>XXXXX</td>
<td>XXXX</td>
<td>XXX</td>
</tr>
<tr>
<td>XXXXXX</td>
<td>XXXXXXX</td>
<td>XXXXXXX</td>
<td>XXXXXXXXX</td>
</tr>
</table> 展开
展开全部
<table width="750" border="0">
<tr>
<td ><label>
<input type="submit" name="button" id="button" value="Copy" onClick="txtstr()" />
</label></td>
</tr>
<tr>
<td id="text">
<table width="750" border="0" cellpadding="5">
<tr>
<td>标题</td>
<td>标题</td>
<td>标题</td>
<td>标题</td>
</tr>
<tr>
<td>XXX</td>
<td>XXXXX</td>
<td>XXXX</td>
<td>XXX</td>
</tr>
<tr>
<td>XXXXXX</td>
<td>XXXXXXX</td>
<td>XXXXXXX</td>
<td>XXXXXXXXX</td>
</tr>
</table>
</td>
</tr>
</table>
<script>
function txtstr(){
if(navigator.appName.indexOf("Explorer") > -1){
var text = document.getElementById("text").innerText;
}else{
var text = document.getElementById("text").textContent;
}
alert(text)
}
</script>
<tr>
<td ><label>
<input type="submit" name="button" id="button" value="Copy" onClick="txtstr()" />
</label></td>
</tr>
<tr>
<td id="text">
<table width="750" border="0" cellpadding="5">
<tr>
<td>标题</td>
<td>标题</td>
<td>标题</td>
<td>标题</td>
</tr>
<tr>
<td>XXX</td>
<td>XXXXX</td>
<td>XXXX</td>
<td>XXX</td>
</tr>
<tr>
<td>XXXXXX</td>
<td>XXXXXXX</td>
<td>XXXXXXX</td>
<td>XXXXXXXXX</td>
</tr>
</table>
</td>
</tr>
</table>
<script>
function txtstr(){
if(navigator.appName.indexOf("Explorer") > -1){
var text = document.getElementById("text").innerText;
}else{
var text = document.getElementById("text").textContent;
}
alert(text)
}
</script>
追问
好像不行啊,粘贴时没有效果
追答
你要做什么?加QQ 说吧 349798025
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询