title: How to print only one div content from html page using print button
body: <p>I have 2 div tags in my html code.and I have 1 print button on the top of the page.when I click on the print button , it is giving me everything in the print what I have on html page(means content from both the divs). I want to restrict this print button's functionality till 1st div only and I will add another print button before next div to print that div content independently. Is there any way I can do this?</p>
  
  <pre><code>    &lt;html&gt;
       &lt;body&gt;
        &lt;input type="button" value="Print" class="noprint" onclick="window.print();return false;"&gt;
         &lt;div&gt;
            ...
            //my content.Want to print only this div when I will click print button.
            ...
         &lt;/div&gt;
         //I will add another print button here which will allow me to print the next div.
         &lt;div&gt;
           ...
            //my content
           ...
          &lt;/div&gt;
        &lt;/body&gt;
       &lt;/html&gt;
  </code></pre>