You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<meta name="Content-Style-Type" content="text/css">
<title>Example</title>
<script type="text/javascript">
if (document.getElementsByTagName) onload = function () {
document.getElementsByTagName ('IFRAME')[0].className = 'hide'
var t = document.createTextNode ('Show')
var button = document.createElement ('BUTTON')
var div = document.createElement ('P')
var body = document.getElementsByTagName ('BODY')[0]
button.onclick = function () {
if (this.firstChild.data == 'Show') {
document.getElementsByTagName ('IFRAME')[0].className = 'show'
this.firstChild.data = 'Hide'
} else {
document.getElementsByTagName ('IFRAME')[0].className = 'hide'
this.firstChild.data = 'Show'
}
}
button.appendChild (t)
div.appendChild (button)
body.appendChild (div)
}
</script>
<style type="text/css">
.hide {display:none;}
</style>
</head>
<body>
<div>
<iframe class="hide" src="http://www.w3.org" width="1000px">
<a href="http://www.w3.org">W3C</a>
</iframe>
</div>
</body>
</html>