Snap Builder Public Codes Library
Snap | Generators | Login | Browse | Search | Enter Code | Export Snap Builder Public Codes Library


Category: Javascript Codes Library >> Miscellaneous Snippets >> Show Hide DIV Content

Code Snippet </> Info

Snippet Name: Show Hide DIV Content

Description: Show / Hide your content by using a text or graphic image link to show or hide the DIV contents.

Compatible Browsers:
Chrome BrowserFirefox BrowserInternet Explorer BrowserOpera BrowserSafari Browser

Example: View Code Demo

Note: Simply nest your show/hide content inside the DIV ID="uniquename" area.

Author: SnapBuilder <>

Last Modified: 2015-03-19 19:40:59

Language: javascript

Highlight Mode: javascript

Copy Codes: Use Free Notepad ++
Bookmark and Share

Snap HTML Code Editor:
Paste the source code, make changes and instantly see it in live preview.
Snap HTML Code Editor

  About Copying
Copied To Clipboard!

<html> <head> <title>Show Hide DIV Content Javascript Code Snippet</title> </head> <body> <script> <!-- Begin Show Hide Content from Free Public Codes Library // Free to use as long as the credit lines remain in place function HideContent(d) { document.getElementById(d).style.display = "none"; } function ShowContent(d) { document.getElementById(d).style.display = "block"; } function ReverseDisplay(d) { if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; } else { document.getElementById(d).style.display = "none"; } } //--> </script> Click The Link For Demo >>> <a href="javascript:ShowContent('uniquename')">Show The Content</a> <div id="uniquename" style="display:none;"><p>This is a Show Hide DIV Content Javascript Code Snippet that will help you show/hide your content inside a DIV box!</p> <a href="javascript:HideContent('uniquename')">Hide The Content Above</a> </div> <br /><br /> <div id="snippet"> [ This code example from <a href="">Show Hide DIV Content</a> page. ] </div> </body> </html>

[ Snippet Options ]


© 2002 -  Snap Builder Public Codes Library