Skip to content

Instantly share code, notes, and snippets.

@jjsub
Created March 13, 2016 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjsub/8a6e9f250d1b3cee8d2e to your computer and use it in GitHub Desktop.
Save jjsub/8a6e9f250d1b3cee8d2e to your computer and use it in GitHub Desktop.
<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
//-->
</script>
@jjsub
Copy link
Author

jjsub commented Mar 13, 2016

More clean

function toggle_visibility(id) {
var e = document.getElementById(id);
e.style.display = ((e.style.display!='none') ? 'none' : 'block');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment