Export html and css to a file using jquery
<p>Imagine I have a 3 column layout. <strong>Left, center and right div</strong>. I want to export only the center div. This is my export method so far:</p>

<pre><code>function getHtml() {
    var htmlStartTag = function(){
        var attrs = $('html')[0].attributes;  
        var result = '&lt;html';
        $.each(attrs, function() { 
            result += ' ' + this.name + '="' + this.value + '"';
        });                                               
        result += '&gt;';
        return result;
    }    

return htmlStartTag() + $('html').html() + '&lt;/html&gt;';
}
</code></pre>

<p>My question is, how can I save the DOM to a html file, say template.html? When the user clicks export, the entire DOM should be saved or downloaded as html file. Is this possible, can you give an example? My application just uses jquery and html. It is not a serverside application!</p>
