Firefox doesn't support outerHTML, so you need to define a function to help support it:
function outerHTML(node) {
return node.outerHTML || (
function(n) {
var div = document.createElement('div');
div.appendChild( n.cloneNode(true) );
var h = div.innerHTML;
div = null;
return h;
}
)(node);
}
Then, you can use outerHTML:
var x = outerHTML($('#container').get(0));
$('#save').val(x);