print the content of a HTML DIV
<p>I want to print a content of a html div and currently i am using this code.</p>

<pre><code>&lt;div id="content"&gt;
&lt;/div&gt;

var printContents = document.getElementById("content").innerHTML;
var originalContents = document.body.innerHTML;

document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
</code></pre>

<p>printing is working correctly. But after that my other functions are stop responding. I'm using angular.js.</p>

<p>any idea? </p>