How to hide, show, or toggle your div
February 12th, 2008 | by Knix | published in javascript
Are you trying to find a way to hide and show your content? The demo below shows a simple yet elegant way of toggling your content and toggling the control text via Javascript and styling.
function toggle() {
var ele = document.getElementById(”toggleText”);
var text = document.getElementById(”displayText”);
if(ele.style.display == “block”) {
ele.style.display = “none”;
text.innerHTML = [...]