Hiding and Displaying Elements via Code (Javascript):
Return to List
' The visibility/invisibility keys off the <div id shown below.
<div id="MyCloseBtn" align="center">
<input type="button" value="Close new window & return to tab view"
onClick="javascript:
if (top.location.href.indexOf('main.asp') > 0)
{
alert('Page has not been opened in a new window -- nothing to close.');
} else {
window.close();}"></div>
</body>
</html>
<script language=javascript>
function hideBtn()
{
var div_ref = document.all("MyCloseBtn");
div_ref.style.visibility = "hidden";
}
function showBtn()
{
var div_ref = document.all("MyCloseBtn");
div_ref.style.visibility = "visible";
}
</script>