Forum Moderators: phranque
I need to make an Iframe invisible onclick but can't seem to get it to work:
<html>
<head>
<title></title>
</head>
<script>
var TestName = document.getElementById("TestFrame")
</script>
<iframe id="TestFrame" src="c:\test.htm" style="height: 100; width: 100;"></iframe>
<a href="#" onClick="document.TestName.style.display=none">Click Here</a>
</body>
</html>
Perhaps I'm being totally BLONDE but any help would really be great!
Thanks!
Walker
For anyone who might need it in the future:
<script>
function CloseWindow() {
var TestName = document.getElementById("TestFrame")
TestName.style.display='none'
}
</script>
<iframe id="TestFrame" src="c:\test.htm" style="height: 100; width: 100;"></iframe>
<a href="#" onClick="CloseWindow()">Click Here</a>
Kind Regards
Walker
it works for
<div> tags too
<script> function CloseWindow() {
var TestName = document.getElementById("TestFrame")
TestName.style.display='none'
}
function showWindow() {
var TestName = document.getElementById("TestFrame")
TestName.style.display=''
}
</script>
something<br><br>
<div id="TestFrame">
some text here
some text here
some text here
some text here
some text here
some text here
some text here
some text here
some text here
some text here
some text here
some text here
some text here
some text here
some text here
some text here
some text here
some text here
</div>
<!-- <iframe id="TestFrame" src="c:\test.htm" style="height: 100; width: 100;"></iframe> -->
<a href="#" onClick="CloseWindow()">Hide text</a>
<a href="#" onClick="showWindow()">Show Text</a>
<br><br>something