I have a situation where I need to fire an event when right clicked on a div with class types_list_button
, but within that div is another div with the class hover_point
in which I do not want the event to fire when they are clicking over that div. Is this possible?
I am not sure if I can use :not
with this type of event handler I am using.
HTML
<div class="types_list_button">Any where here<div class="hover_point">Not Here</div>Any where here</div>
JQUERY
$(document).on('contextmenu', '.types_list_button', function() {
$(document).on('contextmenu', '.types_list_button', function() {
alert("test")
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="types_list_button">Any where here<div class="hover_point">Not Here</div>Any where here</div>