JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" value="Print" class="noprint" onclick="window.print();return false;">
<div class="div1">
...
//my content.Want to print only this div when I will click print button.
...
</div>
<div class="div2">
//I will add another print button here which will allow me to print the next div.</div>
CSS
@media print {
.div1 {display:block;}
.div2 {display:none;}
}