I have the following code HTML
:
<div id="mini-cart" class="mini-cart dropdown is-not-empty">
<span class="ic-cart"></span>
<span class="count-cart" style="display:none;"><br><br></span>
<strong class="minhaCart">minha <span class="compraCart">COMPRA</span></strong>
<span class="caret-cart"></span><br>
<div id="header-cart" class="mini-cart-content dropdown-content left-hand skip-content skip-content- -style block-cart block" style="display: none;">
<span class="msg-carrinho-vazio"> Seu carrinho está vazio :( </span>
</div>
</div>
And the following code jQuery
:
$j('#mini-cart').not('#header-cart').on('click',function(){
alert('Teste');
});
What I wanted to do was that when div
with id="mini-cart"
was clicked, alert
is displayed, however, if div
with id="header-cart"
that is inside it is clicked, alert
can not be displayed.