The page calls a javascript on somebody elses site that shows an image on the screen for advertising, I have no control over the script so I don't know what it does exactly but an image appears on the page.
What I want to do is hide that image on printing.
I will try just using img{display:none;} as I don't have any images on my site and if I do add images I could give them a class such as myimg{display:block;}
What I wanted was to know if I could use the script tag to set the display attribute for everything that is produced by the enclosed script.
While you can use Javascript to programatically hide things, I would say that in this case you would be better off using just CSS as you've shown.
Even better, if the script from <unknown site> inserts its elements in a known container (such as a DIV element with an ID), you could restrict the hiding of images to that container only:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.