/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<style type="text/css"> .divHide{display:none;} .divShow{display:block;} </style> <script type="text/javascript" language="javascript"> function showhide(obj) { var el=document.getElementById(obj); if (el.className == "divHide") { el.className = "divShow"; } else { el.className = "divHide"; } } </script> ... <a onclick="showhide('calendar');" href="#calendar">click here</a>.</p><a name="calendar"></a> <div id="calendar" class="divHide"></div>