0

Hide #shoppingBag if you click outside of it but the toggle function should still work.

Thanks for any help.

This is my code:

   $(document).ready(function () {

        $('.button-cart').click(function(){
          $('#shoppingBag').toggle();
        });

    }); 

HTML

<span class="button-cart">Warenkorb</span>

<div id="shoppingBag"></div>
Alexander H
  • 173
  • 6
  • 22

0 Answers0