Skip to content

Instantly share code, notes, and snippets.

@fordlee404
Created September 10, 2013 02:19
Show Gist options
  • Save fordlee404/6504247 to your computer and use it in GitHub Desktop.
Save fordlee404/6504247 to your computer and use it in GitHub Desktop.
显示/隐藏元素
function toggle(obj) {
var el = document.getElementById(obj);
if ( el.style.display != 'none' ) {
el.style.display = 'none';
}
else {
el.style.display = '';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment