1

I have created a basic HTML page and placed a print button at the bottom which prints the profile of the candidate which is being shown on the page. The problem is it prints the button as well as all the menus on the side and the footer. What should I do to print only the Candidate Profile. This the function I call on clicking on print button.

<script>
    function printbill() {
        window.print();
    }
</script>
rexroxm
  • 868
  • 1
  • 9
  • 26
  • The 800 rep., well you seemed to have taken care of that now. Thanks. – rexroxm Feb 02 '17 at 05:11
  • Just to make sure you understand, I ONLY marked as duplicate, I did not correct your points. I do not think the two were related at all. – mplungjan Feb 02 '17 at 07:44

2 Answers2

1

You could use a print style.

Add the following to your page css:

@media print {
   #header { /* Add the elements you want to hide */
      display: none; 
   }
}
1

Try to use css only:

@media print { 
  #header, #footer, #nav { display: none !important; } 
  .CandidateProfile: { display: block!important }
}