html head title Show Hide Logo on click title script type text javascr

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<html>
<head>
<title>Show Hide Logo on click</title>
<script type="text/javascript" language="javascript">
var logo;
window.onload = function(){
var link = document.getElementById('click');
if(link){
link.onclick = function(){
if(!logo)logo = document.getElementById('logo');
if(logo) {
logo.style.display = (!logo.style.display || logo.style.display == 'none') ? 'block' : 'none';
}
}
}
}
</script>
<style type="text/css">
#logo {
display:none;
}
</style>
</head>
<body>
<a id='click' href="#">Click</a>
<img id='logo' src='main_logo2.gif' />
</body>