whaaaaaaz
whaaaaaaz

Reputation: 39

Jquery:Copyting content from table to div

Trying to copy content of table into a div, and can't make it work...

Here is sample code of the table and div

<table><tr>
    <td class="movr">See this content</td>
</tr></table>
<div class="sample"></div>

and here is jquery code

$(document).ready(function(){
var move = $(".movr").html;
$(".sample").html(move);
});

Can't find the mistake..

Upvotes: 0

Views: 83

Answers (2)

Phong Vo
Phong Vo

Reputation: 1078

$(".movr") returns an array NOT an object, mate.

Upvotes: -1

Milind Anantwar
Milind Anantwar

Reputation: 82241

html is method and not property. Use .html() instead of .html:

var move = $(".movr").html();

Upvotes: 3

Related Questions