View Full Version : show/hide table with a click

11-19-2010, 06:02 AM

i want to hide a table when user click on a link

this is my code looks like

<div id="sh">
<table width="800" border="0">

<div align="center"><a href="JavaScript:window.print();"><img src="images/print.png" alt="Print this page"/></a></div>

is it possible to hide above table at same time print this link clicked?

any help would be great

sorry for language errors


Philip M
11-19-2010, 08:35 AM
<div align="center"><a href="JavaScript:window.print()"; onclick = "document.getElementById('sh').style.display='none';"><img src="images/print.png" alt="Print this page"/></a></div>

You may also use style.visibility = "hidden" if you wish the element being hidden to still occupy its same place in the layout of the page.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

11-19-2010, 09:18 AM