Show Hide or Toggle Content with Javascript
Show Hide or Toggle Content with Javascript
Here is a simple javascript snippet that you can use to toggle the contents of a div.
function toggleDisplay() {
var e = document.getElementById(toggle_div);
e.style.display = (e.style.display == none) ? block : none;
}
<input type="button" value="Toggle Display" onclick="toggleDisplay()" />
<div id="toggle_div" style="display: none">
Hello World.
</div>
download file now
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.