SyntaxFix
Write A Post
Hire A Developer
Questions
Make use of jquery toggle function which do the task for you
.toggle() - Display or hide the matched elements.
$('#myelement').click(function(){ $('#another-element').toggle('slow'); });