how to print part of rendered html page in javascript?
<p>javascript code window.print() can print the current html page. </p>

<p>My question is: if I have a div in an html page(for example, a page rendered from ASP.NET MVC view), then I want to print the div only.</p>

<p>Is there any JQuery Unobtrusive javascrpt or normal javascript to implement this request?</p>

<p>Make it more clear. Suppose the rendered html page like:</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head id="Head" runat="server"&gt;
&lt;title&gt;
        &lt;asp:ContentPlaceHolder runat="server" ID="TitleContent" /&gt;
&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div id="div1" class="div1"&gt;....&lt;/div&gt;
    &lt;div id="div2" class="div2"&gt;....&lt;/div&gt;
    &lt;div id="div3" class="div3"&gt;....&lt;/div&gt;
    &lt;div id="div4" class="div4"&gt;....&lt;/div&gt;    
    &lt;div id="div4" class="div4"&gt;....&lt;/div&gt;
&lt;p&gt;
    &lt;input id="btnSubmit" type="submit" value="Print" onclick="divPrint();" /&gt;
&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Then I want to click on the Print button only printing div3. </p>
