Click to See Complete Forum and Search --> : Hiding frames
msdnexpert
Jul 11th, 2000, 08:55 AM
Hi all,
I have got two frames on an HTML page. The first frame has a form with a button. When I click on the button I want to make the second form invisible. How do I do that in VBScript or JavaScript.
Thanks in advance.
Psyrus
Jul 11th, 2000, 05:21 PM
Try this:
************************************************************
<html>
<head>
<title>Hiding my Div</title>
<script language = "javascript">
function Hide()
{
MyDiv.style.visibility = 'hidden';
}
</script>
</head>
<body>
<br><br><br>
<DIV ALIGN = "CENTER" ID = "MyDiv">
This is my div
</DIV>
<br>
<br>
<input type="button" value = "Hide Div" ONCLICK="Hide()">
</body>
</html>
************************************************************
I believe to access this cross-frame just prefix the MyDiv in the function with the name of your frame. Make sure that you wrap the form in a DIV tag and give the DIV tag an ID to refer to it in the javascript function.
Copy and paste the above HTML into notepad and save it as MyDiv.html to see it work. By clicking on the button the text in the Div tag disappears.
Psyrus
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.