I am trying to add an else statement to this piece of javascript so that if a div-1
is clicked once it shows div-2
and if div-1
is clicked again it hides div-2
.
Does anyone know how I could do this?
<!-- language: lang-js -->$(function() {
$('.div-1').click(function() {
$('.div-2').show();
return false;
});
});