I have a div: <div id="navUserDetailsNotifications"> and another div: <div id="navNotifications">. The initial state is that the first div is displayed (display: flex) and the second one is not (display: none). I want to attach "navUserDetailsNotifications" div 2 event listeners:
- When click on it, then the second one is displayed (display: flex).
- When click on documentand the clicked element is notnavUserDetailsNotificationsthen makedisplay: noneto the second div.
This is my try:
let navUserDetailsNotificationsOBJ = $('#navUserDetailsNotifications');
let navNotificationsOBJ = $('#navNotifications');
$(document).on('click', ':not(#navUserDetailsNotifications)', function() {
        navNotificationsOBJ.css('display', 'none');
});
navUserDetailsNotificationsOBJ.on('click', function() {
        navNotificationsOBJ.css('display', 'flex');
});
This is not working, why is it?
