I have a button on my webpage with the id "print_req" that is used to trigger a JavaScript function for printing the page. I want this button to be hidden during the printing process and then reappear afterwards, so it does not show up in the printed document. Here is my current code:
$(document).ready(function(){
$("#print_req").click(function(){
$("#print_req").css("display","none");
window.print();
});
$("#print_req").css("display","block");
return false;
});
While this code successfully hides the button during printing, it fails to make the button visible again once the printing is completed. What could be causing this issue?