I want that when the click activate the element2 div, the element should disappear. And the element2 div should not appear at the beginning.
$(".toggle").click(function() { $(".element2").toggle(); }); $(".close").click(function() { $(".element2").hide(); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="element"> Element 1 <div class="toggle"> toggle </div> <div class="element2"> Element 2 <div class="close">close Element 2</div> </div> </div>