116 said:
My scripting is limited, and I am trying to clean up some pages that show
DB
results for printing. At the time I click a button to hide some items, I
want a button to for print to become visible.
David,
This code will show or hide the <div> with given id, e.g."hiddenDiv"
I have shown 2 examples. They call the same JS code, but with a different
parameter (the <div> id )
<html>
<head>
<script type="text/javascript">
function showHide(divname){
var a=document.getElementById(divname).style
a.display = (a.display!='none') ? 'none' : 'block'
}
</script>
</head>
<body>
<p>
<input type="button" id="Show" value="Show Hide text"
onclick="showHide('hiddenDiv')" />
</p>
<div id="hiddenDiv">
hidden text
</div>
<p>
<input type="button" id="Show" value="Show Hide text"
onclick="showHide('hiddenDiv2')" />
</p>
<div id="hiddenDiv2">
hidden text 2
</div>
</body>
</html>