title: How to print only parts of a page?
body: <p>I am trying to hide some divs before the user prints this giant form, then display the divs again afterward. Thus I want to ignore the rest of the page, and only print the form itself.</p>
  
  <p>Sure I <em>could</em> open a separate page when the user clicks the print button. The only thing is that the form is really long and it would be quite tedious to do that.</p>
  
  <p><br>
  Edit: My previous question did not actually reflect what I was looking for. So I changed it to the current one.</p>
  
  <p>Also thanks to all that suggested window.onbeforeprint and window.onafterprint. That was relevant to my edited question.</p>