I'm trying to get this running
$('#info').replaceWith('<div id="infobox" class="reveal-modal">'+$('#info').contents()+'<a class="close-reveal-modal">×</a></div>');
but It just gives me [object Object]. As I only replace it with $('#info').contents() things work fine.
$('#info').contents()is an object and the default string representation of an object is[object Object]. You cannot just concatenate strings with arbitrary objects.