I was trying my print code on different devices and on my phone the hidden elements still showed up after:
document.getElementById("head").style.display = "none";
and then:
document.print();
So my question is:
is there any way to hide it on phone or is there another print method.
I also tried visibility: hidden;.
            Asked
            
        
        
            Active
            
        
            Viewed 31 times
        
    0
            
            
         
    
    
        my profile
        
- 37
- 9
- 
                    you can have `@media print { }` stylesheet rules. – Pointy Jan 17 '22 at 19:31
- 
                    check out this https://stackoverflow.com/questions/355313/how-do-i-hide-an-element-when-printing-a-web-page?rq=1 – najmieh sadat safarabadi Jan 17 '22 at 20:10