我在我的html代码中有2个div标签,我在页面顶部有1个打印按钮。当我点击打印按钮时,它给我在印刷品上的一切都在我的HTML页面上(意味着来自两个div的内容)。我想限制此打印按钮的功能,直到1st div,我将在下一个div之前添加另一个打印按钮,以独立打印该div内容。有什么办法可以做到这一点?如何使用打印按钮从html页面打印只有一个div内容
<html>
<body>
<input type="button" value="Print" class="noprint" onclick="window.print();return false;">
<div>
...
//my content.Want to print only this div when I will click print button.
...
</div>
//I will add another print button here which will allow me to print the next div.
<div>
...
//my content
...
</div>
</body>
</html>