Return to Snippet

Revision: 4916
at January 28, 2008 20:13 by iTony


Initial Code
<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>

Initial URL

                                

Initial Description

                                

Initial Title
simple toggle html element

Initial Tags
css, javascript

Initial Language
JavaScript