Title: Show/Hide Code Snippets
Last modified: August 21, 2016

---

# Show/Hide Code Snippets

 *  [Steven](https://wordpress.org/support/users/lamsteven94/)
 * (@lamsteven94)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/showhide-code-snippets/)
 * Hello!
 * I must first say, I really like this plugin and it’s awesome! I would like to
   create some buttons to show and hide these code snippets because they can get
   lengthy. However my code does not work and I can’t seem to understand why.
 * <button class=”codeButtons” onclick=”show(‘code6’)”>Show Me</button> <button 
   class=”codeButtons” onclick=”hide(‘code6’)”>Hide</button>
    </p> <div id=”code6″
   style=”display:none;”>[snippet id=”52″]</div>
 * and the functions show and hide are:
    function hide(name) { document.getElementById(
   name).style.display=”none”; }
 * function show(name)
    { document.getElementById(name).style.display=”block”; }
 * – When I press the show button, it reveals the div but not the code snippet. 
   Do you have any advice as to how I can solve this issue?
 * [http://wordpress.org/plugins/code-snippet-library/](http://wordpress.org/plugins/code-snippet-library/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [Steven](https://wordpress.org/support/users/lamsteven94/)
 * (@lamsteven94)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/showhide-code-snippets/#post-4505078)
 * Oh sorry, forgot to mention the webpage:
 * [http://slamlink.net/java/lab-6-black-jack/](http://slamlink.net/java/lab-6-black-jack/)
 * the buttons are at the very bottom on the right column. Thanks!

Viewing 1 replies (of 1 total)

The topic ‘Show/Hide Code Snippets’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/code-snippet-library_92e341.svg)
 * [Code Snippet Library](https://wordpress.org/plugins/code-snippet-library/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippet-library/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippet-library/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippet-library/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippet-library/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippet-library/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Steven](https://wordpress.org/support/users/lamsteven94/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/showhide-code-snippets/#post-4505078)
 * Status: not resolved