尝试将表格内容复制到 div 中,但无法使其工作...
这是表格和div的示例代码
<table><tr>
<td class="movr">See this content</td>
</tr></table>
<div class="sample"></div>
这是 jquery 代码
$(document).ready(function(){
var move = $(".movr").html;
$(".sample").html(move);
});
找不到错误..
最佳答案
html
是方法而不是属性。使用 .html()
而不是 .html
:
var move = $(".movr").html();
关于javascript - Jquery:将内容从表复制到div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26707042/