i am trying to clone a particular div and do some manipulation to clear the content and return.
var tmp = $('<div>').append($('#masterdiv').clone()).remove().html();
It works fine in firefox. but in IE and chrome, this removed the entire div instead of cloning.
Whats the workaround for this?
Edit:
The main aim is to copy the entire master div and clear the contents inside the child divs and update it in the database using json. The actual master and child divs(which i take it as place holders for my content) will be rendered from database.
It should not clear the existing content unless the admin approves the layout.
So i tried to clone the div and manipulate, then the problem cames with the IE and chrome..