<script>
function toggle(){
if(document.getElementById("MyId").className == "hide")
document.getElementById("MyId").className = "show";
else
document.getElementById("MyId").className = "hide";
}
</script>
<a href="#" id="togglebutton" onclick="toggle()">Show/hide</a>
<div id="MyId" class="show">
I want this div to toggle between the 'show' class and the 'hide' class
</div>