Reputation: 4898
I'm trying here - http://jsfiddle.net/stevea/CRVpL/2/ - to view the source for a div.
The first line below picks up the html ok but the next line doesn't put it where I want.
var inhtml = $('#box1').html();
$(inhtml).appendTo('#displaysource');
Could someone point out the correct way to do this? Thanks
Upvotes: 0
Views: 89
Reputation: 112
var inhtml = $('#box1').html();
$(inhtml).appendTo('#displaysource');
TO
var inhtml = $('#box1');
$(inhtml).appendTo('#displaysource');
if you want to move the contents make this:
var inhtml = $('#box1').text();
$('#displaysource').text(inhtml);
Hope you can help
Upvotes: 0
Reputation: 44376
var inhtml = $('#box1').html();
$('#displaysource').text(inhtml);
Upvotes: 1